[Xfce4-commits] [xfce/xfwm4] 01/02: Use smallest screen area

noreply at xfce.org noreply at xfce.org
Tue Feb 24 22:38:59 CET 2015


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

olivier pushed a commit to branch master
in repository xfce/xfwm4.

commit 68365da4bb048f03871ab32882e47098bd9d4218
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Tue Feb 24 22:23:48 2015 +0100

    Use smallest screen area
    
    Bug: 11059
    
    Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
 src/screen.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/screen.c b/src/screen.c
index 095b371..08104ac 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -627,6 +627,7 @@ myScreenComputeSize (ScreenInfo *screen_info)
 {
     gint num_monitors, i;
     gint width, height;
+    gint screen_width, screen_height;
     GdkRectangle monitor;
     gboolean changed;
 
@@ -650,6 +651,22 @@ myScreenComputeSize (ScreenInfo *screen_info)
         height = MAX (monitor.y + monitor.height, height);
     }
 
+    /* Keep the smallest size between what we computed and the
+     * reported size for the screen.
+     */
+    screen_width = gdk_screen_get_width (screen_info->gscr);
+    screen_height = gdk_screen_get_height (screen_info->gscr);
+
+    if (width == 0 || width > screen_width)
+    {
+        width = screen_width;
+    }
+
+    if (height == 0 || height > screen_height)
+    {
+        height = screen_height;
+    }
+
     changed = ((screen_info->width != width) | (screen_info->height != height));
     screen_info->width = width;
     screen_info->height = height;

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


More information about the Xfce4-commits mailing list