diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 010d14a..d021642 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -31,6 +31,7 @@
 
 #define GNOME_DESKTOP_USE_UNSTABLE_API
 #include <libgnome-desktop/gnome-rr.h>
+#include <libgnome-desktop/gnome-rr-config.h>
 
 #ifdef HAVE_LIBCANBERRA
 #include <canberra-gtk.h>
@@ -2112,6 +2113,48 @@
         }
 }
 
+/**
+ * should_ignore_lid_close:
+ * @manager: This class instance
+ *
+ * Check whether the computer can be used while the laptop display is not
+ * visible.  If so, we will ignore lid close events.
+ **/
+static gboolean
+should_ignore_lid_close(void)
+{
+	GnomeRRScreen *screen;
+	GnomeRRConfig *current;
+	GnomeRROutput **outputs;
+	guint i;
+	gboolean mirror_is_active, have_external_display, need_laptop_display;
+	GError *error = NULL;
+
+	screen = gnome_rr_screen_new (gdk_screen_get_default (), &error);
+	if (error) {
+		g_error_free (error);
+		return TRUE;
+	}
+
+	current = gnome_rr_config_new_current (screen, NULL);
+	mirror_is_active = gnome_rr_config_get_clone (current);
+	g_object_unref (current);
+
+	have_external_display = FALSE;
+	need_laptop_display = FALSE;
+	outputs = gnome_rr_screen_list_outputs (screen);
+	for (i = 0; outputs[i] != NULL; i++) {
+		if (!gnome_rr_output_is_connected (outputs[i]))
+			/* ignore this display */ ;
+		else if (!gnome_rr_output_is_laptop (outputs[i]))
+			have_external_display = TRUE;
+		else if (gnome_rr_output_get_is_primary (outputs[i]))
+			need_laptop_display = !mirror_is_active;
+	}
+	g_object_unref (screen);
+	return have_external_display && !need_laptop_display;
+}
+
 static void
 do_lid_closed_action (GsdPowerManager *manager)
 {
@@ -2147,9 +2190,8 @@
                 }
         }
 
-        /* are we docked? */
-        if (up_client_get_is_docked (manager->priv->up_client)) {
-                g_debug ("ignoring lid closed action because we are docked");
+        if (should_ignore_lid_close ()) {
+                g_debug ("ignoring lid closed action due to randr settings");
                 return;
         }
 
