summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-12-19 10:37:36 +0100
committerraveit65 <[email protected]>2021-12-19 22:55:45 +0100
commita6dbb5f0d4ec6e846c1850ad9a9990c9f21e3e0e (patch)
tree3d76d946b83aae79f36a8f6c5462b418cd301be1
parent82cb82b8cdead5d1a50705aca1bdac8ffa91432f (diff)
downloadmate-panel-a6dbb5f0d4ec6e846c1850ad9a9990c9f21e3e0e.tar.bz2
mate-panel-a6dbb5f0d4ec6e846c1850ad9a9990c9f21e3e0e.tar.xz
Upscale in panel_xutils_set_strut
-rw-r--r--mate-panel/panel-struts.c23
-rw-r--r--mate-panel/panel-struts.h3
-rw-r--r--mate-panel/panel-toplevel.c7
-rw-r--r--mate-panel/panel-xutils.c4
4 files changed, 13 insertions, 24 deletions
diff --git a/mate-panel/panel-struts.c b/mate-panel/panel-struts.c
index 0b5e1645..3e5e5857 100644
--- a/mate-panel/panel-struts.c
+++ b/mate-panel/panel-struts.c
@@ -322,8 +322,8 @@ panel_struts_set_window_hint (PanelToplevel *toplevel)
panel_xutils_set_strut (gtk_widget_get_window (widget),
strut->orientation,
strut_size,
- strut->allocated_strut_start * scale,
- strut->allocated_strut_end * scale,
+ strut->allocated_strut_start,
+ strut->allocated_strut_end,
&strut->allocated_geometry,
scale);
}
@@ -415,8 +415,7 @@ panel_struts_register_strut (PanelToplevel *toplevel,
PanelOrientation orientation,
int strut_size,
int strut_start,
- int strut_end,
- gint scale)
+ int strut_end)
{
PanelStrut *strut;
gboolean new_strut = FALSE;
@@ -454,33 +453,25 @@ panel_struts_register_strut (PanelToplevel *toplevel,
strut->geometry.x = strut->strut_start;
strut->geometry.y = monitor_y;
strut->geometry.width = strut->strut_end - strut->strut_start + 1;
- strut->geometry.height = strut->strut_size / scale;
- if (scale > 1)
- strut->geometry.width -= (strut->strut_size / scale);
+ strut->geometry.height = strut->strut_size;
break;
case PANEL_ORIENTATION_BOTTOM:
strut->geometry.x = strut->strut_start;
strut->geometry.y = monitor_y + monitor_height - strut->strut_size;
strut->geometry.width = strut->strut_end - strut->strut_start + 1;
- strut->geometry.height = strut->strut_size / scale;
- if (scale > 1)
- strut->geometry.width -= (strut->strut_size / scale);
+ strut->geometry.height = strut->strut_size;
break;
case PANEL_ORIENTATION_LEFT:
strut->geometry.x = monitor_x;
strut->geometry.y = strut->strut_start;
- strut->geometry.width = strut->strut_size / scale;
+ strut->geometry.width = strut->strut_size;
strut->geometry.height = strut->strut_end - strut->strut_start + 1;
- if (scale > 1)
- strut->geometry.height -= (strut->strut_size / scale);
break;
case PANEL_ORIENTATION_RIGHT:
strut->geometry.x = monitor_x + monitor_width - strut->strut_size;
strut->geometry.y = strut->strut_start;
- strut->geometry.width = strut->strut_size / scale;
+ strut->geometry.width = strut->strut_size;
strut->geometry.height = strut->strut_end - strut->strut_start + 1;
- if (scale > 1)
- strut->geometry.height -= (strut->strut_size / scale);
break;
}
diff --git a/mate-panel/panel-struts.h b/mate-panel/panel-struts.h
index 4d7e49d0..6741e084 100644
--- a/mate-panel/panel-struts.h
+++ b/mate-panel/panel-struts.h
@@ -43,8 +43,7 @@ gboolean panel_struts_register_strut (PanelToplevel *toplevel,
PanelOrientation orientation,
int strut_size,
int strut_start,
- int strut_end,
- gint scale);
+ int strut_end);
void panel_struts_unregister_strut (PanelToplevel *toplevel);
diff --git a/mate-panel/panel-toplevel.c b/mate-panel/panel-toplevel.c
index bb4aa689..1bff5c54 100644
--- a/mate-panel/panel-toplevel.c
+++ b/mate-panel/panel-toplevel.c
@@ -1518,10 +1518,6 @@ static gboolean panel_toplevel_update_struts(PanelToplevel* toplevel, gboolean e
}
}
- /* Adjust strut size based on scale factor */
- if (strut > 0)
- strut += toplevel->priv->size * (toplevel->priv->scale - 1);
-
if (orientation != toplevel->priv->orientation) {
toplevel->priv->orientation = orientation;
g_object_notify (G_OBJECT (toplevel), "orientation");
@@ -1541,8 +1537,7 @@ static gboolean panel_toplevel_update_struts(PanelToplevel* toplevel, gboolean e
orientation,
strut,
strut_start,
- strut_end,
- toplevel->priv->scale);
+ strut_end);
}
else {
panel_struts_unregister_strut (toplevel);
diff --git a/mate-panel/panel-xutils.c b/mate-panel/panel-xutils.c
index eb887e71..5331ff59 100644
--- a/mate-panel/panel-xutils.c
+++ b/mate-panel/panel-xutils.c
@@ -92,6 +92,10 @@ panel_xutils_set_strut (GdkWindow *gdk_window,
if (gnome_wm_strut_area == None)
gnome_wm_strut_area = XInternAtom (xdisplay, "_GNOME_WM_STRUT_AREA", False);
+ strut *= scale;
+ strut_start *= scale;
+ strut_end *= scale;
+
switch (orientation) {
case PANEL_ORIENTATION_LEFT:
struts [STRUT_LEFT] = strut;