[Xfce4-commits] <xfwm4:xfce-4.6> 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 17:14:01 CET 2010


Updating branch refs/heads/xfce-4.6
         to fe30b3a618a5f6cb4654d060b3403ade97022b28 (commit)
       from 7e7ad3e658f486b914e77247ce25cdea0064c727 (commit)

commit fe30b3a618a5f6cb4654d060b3403ade97022b28
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 d36b628..76c9945 100644
--- a/src/events.c
+++ b/src/events.c
@@ -2805,6 +2805,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 1ff8543..5c58e71 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