[Xfce4-commits] [xfce/xfce4-panel] 01/01: Add comments for using deprecated struts code
noreply at xfce.org
noreply at xfce.org
Tue Dec 4 00:28:38 CET 2018
This is an automated email from the git hooks/post-receive script.
o c h o s i 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/xfce4-panel.
commit d45ce7bda97705952bce63f41e896908c84f1696
Author: Alistair Buxton <a.j.buxton at gmail.com>
Date: Tue Dec 4 00:28:01 2018 +0100
Add comments for using deprecated struts code
---
panel/panel-window.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/panel/panel-window.c b/panel/panel-window.c
index cddc94b..63776b3 100644
--- a/panel/panel-window.c
+++ b/panel/panel-window.c
@@ -1693,7 +1693,10 @@ panel_window_screen_struts_set (PanelWindow *window)
scale_factor = gdk_monitor_get_scale_factor(monitor);
/* set the struts */
- /* note that struts are relative to the screen edge! */
+ /* Note that struts are relative to the screen edge! (NOT the monitor)
+ This means we have no choice but to use deprecated GtkScreen calls.
+ The screen height/width can't be calculated from monitor geometry
+ because it can extend beyond the lowest/rightmost monitor. */
if (window->struts_edge == STRUTS_EDGE_TOP)
{
/* the window is snapped on the top screen edge */
@@ -1704,7 +1707,9 @@ panel_window_screen_struts_set (PanelWindow *window)
else if (window->struts_edge == STRUTS_EDGE_BOTTOM)
{
/* the window is snapped on the bottom screen edge */
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
struts[STRUT_BOTTOM] = (gdk_screen_get_height(window->screen) - alloc->y) * scale_factor;
+G_GNUC_END_IGNORE_DEPRECATIONS
struts[STRUT_BOTTOM_START_X] = alloc->x * scale_factor;
struts[STRUT_BOTTOM_END_X] = (alloc->x + alloc->width - 1) * scale_factor;
}
@@ -1718,7 +1723,9 @@ panel_window_screen_struts_set (PanelWindow *window)
else if (window->struts_edge == STRUTS_EDGE_RIGHT)
{
/* the window is snapped on the right screen edge */
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
struts[STRUT_RIGHT] = (gdk_screen_get_width(window->screen) - alloc->x) * scale_factor;
+G_GNUC_END_IGNORE_DEPRECATIONS
struts[STRUT_RIGHT_START_Y] = alloc->y * scale_factor;
struts[STRUT_RIGHT_END_Y] = (alloc->y + alloc->height - 1) * scale_factor;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list