summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2021-05-23 15:37:01 +0200
committerraveit65 <[email protected]>2021-05-29 14:25:03 +0200
commit8c9f71424126ce7bf7aa6f6b4ba36ef611934db4 (patch)
tree31ad78b454d2235a505dcecd1e31e846ff818cd0
parentf55f530d3558d7f1576dc84f62110f493a402fe6 (diff)
downloadmate-panel-WM_STRUT_AREA_new.tar.bz2
mate-panel-WM_STRUT_AREA_new.tar.xz
panel-xutils: make sure struts are in device pixelsWM_STRUT_AREA_new
origin commit: https://gitlab.gnome.org/GNOME/gnome-panel/-/commit/e85b2d2
-rw-r--r--mate-panel/panel-xutils.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/mate-panel/panel-xutils.c b/mate-panel/panel-xutils.c
index 22e9ce78..fb7bacbe 100644
--- a/mate-panel/panel-xutils.c
+++ b/mate-panel/panel-xutils.c
@@ -29,6 +29,7 @@
#endif
#include "panel-xutils.h"
+#include "panel-util.h"
#include <glib.h>
#include <gdk/gdk.h>
@@ -65,6 +66,7 @@ panel_xutils_set_strut (GdkWindow *gdk_window,
{
Display *xdisplay;
Window window;
+ int window_scale;
gulong struts [12] = { 0, };
gulong area[4] = { 0, };
GdkDisplay *display;
@@ -82,6 +84,8 @@ panel_xutils_set_strut (GdkWindow *gdk_window,
if (gnome_wm_strut_area == None)
gnome_wm_strut_area = XInternAtom (xdisplay, "_GNOME_WM_STRUT_AREA", False);
+ window_scale = panel_util_get_window_scaling_factor ();
+
switch (orientation) {
case PANEL_ORIENTATION_LEFT:
struts [STRUT_LEFT] = strut;
@@ -105,10 +109,10 @@ panel_xutils_set_strut (GdkWindow *gdk_window,
break;
}
- area[0] = rect->x;
- area[1] = rect->y;
- area[2] = rect->width;
- area[3] = rect->height;
+ area[0] = rect->x * window_scale;
+ area[1] = rect->y * window_scale;
+ area[2] = rect->width * window_scale;
+ area[3] = rect->height * window_scale;
display = gdk_window_get_display (gdk_window);
gdk_x11_display_error_trap_push (display);