From 696713ba60abf545f8a87e0125001cd64992d3e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 15 Aug 2024 14:44:56 -0700 Subject: [PATCH] PanelWindow: divide dimensions by scale on Wayland --- src/PanelWindow.vala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/PanelWindow.vala b/src/PanelWindow.vala index cd6669fb..166c327b 100644 --- a/src/PanelWindow.vala +++ b/src/PanelWindow.vala @@ -99,6 +99,12 @@ public class Wingpanel.PanelWindow : Gtk.Window { // We just use our monitor because Gala makes sure we are always on the primary one var monitor_dimensions = get_display ().get_monitor_at_window (get_window ()).get_geometry (); + if (Gdk.Display.get_default () is Gdk.Wayland.Display) { + monitor_dimensions.width /= get_scale_factor (); + monitor_dimensions.height /= get_scale_factor (); + monitor_dimensions.x /= get_scale_factor (); + monitor_dimensions.y /= get_scale_factor (); + } monitor_width = monitor_dimensions.width; monitor_height = monitor_dimensions.height;