From 089395207ccf5ddb70faa008850bb6134a95447f Mon Sep 17 00:00:00 2001 From: Jas Singh Date: Tue, 30 Jul 2024 22:40:08 -0700 Subject: [PATCH] Fixes #28 & #32 - Hyprland's auto-scaling is now taken into account. (#49) --- modules/menus/DropdownMenu.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/menus/DropdownMenu.ts b/modules/menus/DropdownMenu.ts index 5c3cfc4..0526b15 100644 --- a/modules/menus/DropdownMenu.ts +++ b/modules/menus/DropdownMenu.ts @@ -17,6 +17,7 @@ const moveBoxToCursor = (self: any, fixed: boolean) => { } globalMousePos.connect("changed", ({ value }) => { + const hyprScaling = hyprland.monitors[hyprland.active.monitor.id].scale; const currentWidth = self.child.get_allocation().width; let monWidth = hyprland.monitors[hyprland.active.monitor.id].width; @@ -32,6 +33,9 @@ const moveBoxToCursor = (self: any, fixed: boolean) => { const scale = parseFloat(gdkScale); monWidth = monWidth / scale; monHeight = monHeight / scale; + } else { + monWidth = monWidth / hyprScaling; + monHeight = monHeight / hyprScaling; } // If monitor is vertical (transform = 1 || 3) swap height and width