aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2024-06-18 13:01:42 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2024-06-18 13:01:55 +0200
commit041352dd0df6814b995fe61b7be1965e6b369485 (patch)
treee9cfa62afa7b4831105902770495c6dffa493aa6
parent141a1820c7ed9af360a40b065c1493c53263b5e4 (diff)
downloadarctica-greeter-041352dd0df6814b995fe61b7be1965e6b369485.tar.gz
arctica-greeter-041352dd0df6814b995fe61b7be1965e6b369485.tar.bz2
arctica-greeter-041352dd0df6814b995fe61b7be1965e6b369485.zip
src/main-window.vala: In set_struts() consider window scaling when calculting _NET_WM_STRUT{,_PARTIAL} (fixes broken geometry).
Regression fix for 275703604d44fff336f631f93e7a47bb3a3b09fd.
-rw-r--r--src/main-window.vala25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/main-window.vala b/src/main-window.vala
index dff1fa2..8d841e8 100644
--- a/src/main-window.vala
+++ b/src/main-window.vala
@@ -257,6 +257,7 @@ public class MainWindow : Gtk.Window
}
var screen = window.screen;
+ int scale = window.get_scale_factor();
if (primary_monitor == null) {
return;
@@ -268,25 +269,25 @@ public class MainWindow : Gtk.Window
// Struts dependent on position
switch (position) {
case MenubarPositions.TOP:
- struts[Struts.TOP] = (menubar_size + primary_monitor.y);
- struts[Struts.TOP_START] = primary_monitor.x;
- struts[Struts.TOP_END] = (primary_monitor.x + primary_monitor.width) - 1;
+ struts[Struts.TOP] = (menubar_size + primary_monitor.y) * scale;
+ struts[Struts.TOP_START] = primary_monitor.x * scale;
+ struts[Struts.TOP_END] = (primary_monitor.x + primary_monitor.width) * scale - 1;
break;
case MenubarPositions.LEFT:
- struts[Struts.LEFT] = (primary_monitor.x + menubar_size);
- struts[Struts.LEFT_START] = primary_monitor.y;
- struts[Struts.LEFT_END] = (primary_monitor.y + primary_monitor.height) - 1;
+ struts[Struts.LEFT] = (primary_monitor.x + menubar_size) * scale;
+ struts[Struts.LEFT_START] = primary_monitor.y * scale;
+ struts[Struts.LEFT_END] = (primary_monitor.y + primary_monitor.height) * scale - 1;
break;
case MenubarPositions.RIGHT:
- struts[Struts.RIGHT] = (menubar_size + screen.get_width() - primary_monitor.x - primary_monitor.width);
- struts[Struts.RIGHT_START] = primary_monitor.y;
- struts[Struts.RIGHT_END] = (primary_monitor.y + primary_monitor.height) - 1;
+ struts[Struts.RIGHT] = (menubar_size + screen.get_width() - primary_monitor.x - primary_monitor.width) * scale;
+ struts[Struts.RIGHT_START] = primary_monitor.y * scale;
+ struts[Struts.RIGHT_END] = (primary_monitor.y + primary_monitor.height) * scale - 1;
break;
case MenubarPositions.BOTTOM:
default:
- struts[Struts.BOTTOM] = (menubar_size + screen.get_height() - primary_monitor.y - primary_monitor.height);
- struts[Struts.BOTTOM_START] = primary_monitor.x;
- struts[Struts.BOTTOM_END] = (primary_monitor.x + primary_monitor.width) - 1;
+ struts[Struts.BOTTOM] = (menubar_size + screen.get_height() - primary_monitor.y - primary_monitor.height) * scale;
+ struts[Struts.BOTTOM_START] = primary_monitor.x * scale;
+ struts[Struts.BOTTOM_END] = (primary_monitor.x + primary_monitor.width) * scale - 1;
break;
}