[Xfce4-commits] [xfce/xfce4-panel] 01/01: Use actual output geometry to place panels

noreply at xfce.org noreply at xfce.org
Sat Feb 28 10:40:38 CET 2015


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

olivier pushed a commit to branch master
in repository xfce/xfce4-panel.

commit e93f54f1ee559700b1310b0ead65f9892604831b
Author: John Lindgren <john.lindgren at aol.com>
Date:   Sat Feb 28 10:27:33 2015 +0100

    Use actual output geometry to place panels
    
    Bug: 11058
    
    The logical screen width/height as reported by X may be larger than
    the outer bounds of all the monitors combined.
    
    Compute the actual outer bounds of the monitors and place the panel
    accordingly.
    
    But keep the struts based on the logical screen width/height as this is
    what the standard expects.
---
 panel/panel-window.c |   21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/panel/panel-window.c b/panel/panel-window.c
index 8f30e41..c21aac3 100644
--- a/panel/panel-window.c
+++ b/panel/panel-window.c
@@ -1948,9 +1948,24 @@ panel_window_screen_layout_changed (GdkScreen   *screen,
 
       /* get the screen geometry we also use this if there is only
        * one monitor and no output is choosen, as a fast-path */
-      a.x = a.y = 0;
-      a.width = gdk_screen_get_width (screen);
-      a.height = gdk_screen_get_height (screen);
+      gdk_screen_get_monitor_geometry (screen, 0, &a);
+
+      a.width += a.x;
+      a.height += a.y;
+
+      for (n = 1; n < n_monitors; n++)
+        {
+          gdk_screen_get_monitor_geometry (screen, n, &b);
+
+          a.x = MIN (a.x, b.x);
+          a.y = MIN (a.y, b.y);
+          a.width = MAX (a.width, b.x + b.width);
+          a.height = MAX (a.height, b.y + b.height);
+        }
+
+      a.width -= a.x;
+      a.height -= a.y;
+
       panel_return_if_fail (a.width > 0 && a.height > 0);
     }
   else if (window->output_name != NULL

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


More information about the Xfce4-commits mailing list