[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)
Jérôme Guelfucci
noreply at xfce.org
Fri Mar 5 10:54:13 CET 2010
Updating branch refs/heads/master
to fa3cc3738d8537d7b94dd497467a45eab8eda3de (commit)
from 3cac7a4504f641baf129b6b38794983dd2159e9c (commit)
commit fa3cc3738d8537d7b94dd497467a45eab8eda3de
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 898b39e..4d5cc55 100644
--- a/src/events.c
+++ b/src/events.c
@@ -2730,6 +2730,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