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

noreply at xfce.org noreply at xfce.org
Thu Jun 1 09:41:57 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       x   f   c   e   -   4   .   1   2   
   in repository xfce/xfwm4.

commit 2bd611c255570c04b2c092fee35caa6f4d43c663
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.
    
    (cherry picked from commit 2aaf9e3328084cc268ffe290f7dd14d7327e1e50)
---
 src/screen.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/screen.c b/src/screen.c
index 34e3d76..4a790e9 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -832,9 +832,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