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

noreply at xfce.org noreply at xfce.org
Sun Feb 26 16:34:20 CET 2017


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

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

commit f063b2ce2f3a7f9a922f482ad5671dd108b78323
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 73f8cc9..b090eb7 100644
--- a/panel/panel-window.c
+++ b/panel/panel-window.c
@@ -1945,9 +1945,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