[Xfce4-commits] <xfwm4:master> Recent Xorg drivers disable the output when the lid is closed, leaving no active monitor, in that case simply ignore the event to avoid messing with windows' positions (Bug #6209)

Olivier Fourdan noreply at xfce.org
Tue Feb 9 16:50:01 CET 2010


Updating branch refs/heads/master
         to 3ad0be62313cad554f6d7980fb02e88abafd12e6 (commit)
       from 06c2229450aefda8e2526c68ef4f096225286d34 (commit)

commit 3ad0be62313cad554f6d7980fb02e88abafd12e6
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Tue Feb 9 16:36:46 2010 +0100

    Recent Xorg drivers disable the output when the lid is closed, leaving no active monitor, in that case simply ignore the event to avoid messing with windows' positions (Bug #6209)

 src/events.c |   10 ++++++++++
 src/screen.c |    5 +++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/events.c b/src/events.c
index 0c452a1..dcac9a8 100644
--- a/src/events.c
+++ b/src/events.c
@@ -2729,6 +2729,16 @@ size_changed_cb(GdkScreen *gscreen, gpointer data)
     g_return_if_fail (screen_info);
     display_info = screen_info->display_info;
 
+    if (gdk_screen_get_n_monitors (screen_info->gscr) == 0)
+    {
+        /*
+         * Recent Xorg drivers remove all monitors on laptops when lid
+         * is closed, in that case, simply ignore the event to avoid
+         * messing with windows' positions for nothing.
+         */
+        return;
+    }
+
     /*
      * We have added/removed a monitor or even changed the layout,
      * the cache for monitor position we use in our screen structure
diff --git a/src/screen.c b/src/screen.c
index 402b5a6..4570fc4 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -584,6 +584,11 @@ myScreenComputeSize (ScreenInfo *screen_info)
     height = 0;
     num_monitors = gdk_screen_get_n_monitors (screen_info->gscr);
 
+    if (num_monitors == 0)
+    {
+        return FALSE;
+    }
+
     for (i = 0; i < num_monitors; i++)
     {
         gdk_screen_get_monitor_geometry (screen_info->gscr, i, &monitor);



More information about the Xfce4-commits mailing list