[Xfce4-commits] [xfce/xfwm4] 01/01: screen: Fix broken monitor index

noreply at xfce.org noreply at xfce.org
Thu Jun 1 09:41:33 CEST 2017


This is an automated email from the git hooks/post-receive script.

o   l   i   v   i   e   r       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfwm4.

commit 0c7bc537e215e4910430fb561ad6268a90f519f6
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Thu Jun 1 09:30:40 2017 +0200

    screen: Fix broken monitor index
    
    Bug: 13608
    
    Commit 5895577 (Use ximerama indices for _NET_WM_FULLSCREEN_MONITORS)
    introduced a regression because the monitor index was wrongly compared
    against the total number of monitors, which would falsely assume that
    the Xrandr query failed whereas it actually worked.
    
    Fix the false comparison and also use the screen size as fallback values
    in case the Xrandr really failed so that we don't end up using random
    uninitialized values.
---
 src/screen.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/screen.c b/src/screen.c
index 3cdc7cb..cfb3884 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -828,9 +828,17 @@ myScreenGetXineramaMonitorGeometry (ScreenInfo *screen_info, gint monitor_num, G
     g_return_if_fail (XineramaIsActive (myScreenGetXDisplay (screen_info)));
 
     infos = XineramaQueryScreens (myScreenGetXDisplay (screen_info), &n);
-    if (infos == NULL || n <= 0 || monitor_num < n || monitor_num > n)
+    if (infos == NULL || n <= 0 || monitor_num > n)
     {
+        g_warning ("Cannot query Xinerama!");
         XFree (infos);
+
+        /* Using screen size as fallback, safer than some random values */
+        rect->x = 0;
+        rect->y = 0;
+        rect->width = screen_info->width;
+        rect->height = screen_info->height;
+
         return;
     }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list