From 7860e2638e3a2a29b2555672192eb3d0afb1fcfb Mon Sep 17 00:00:00 2001 From: matt1432 Date: Wed, 27 Dec 2023 16:14:14 -0500 Subject: [PATCH] fix(ags overview): try to fix multi-monitor issue --- devices/wim/config/ags/js/overview/clients.js | 14 ++++++++++++-- devices/wim/config/ags/js/overview/main.js | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/devices/wim/config/ags/js/overview/clients.js b/devices/wim/config/ags/js/overview/clients.js index e802b29..90f7cf3 100644 --- a/devices/wim/config/ags/js/overview/clients.js +++ b/devices/wim/config/ags/js/overview/clients.js @@ -137,8 +137,18 @@ export const updateClients = (box) => { const active = client.address === Hyprland.active.client.address; - // TODO: fix multi monitor issue. this is just a temp fix - client.at[1] -= 2920; + // TODO: see if this works on multi monitor setup + const alloc = box.get_allocation(); + let monitor = box.get_display() + .get_monitor_at_point(alloc.x, alloc.y); + + monitor = Hyprland.monitors.find((mon) => { + return mon.make === monitor.manufacturer && + mon.model === monitor.model; + }); + + client.at[0] -= monitor.x; + client.at[1] -= monitor.y; // Special workspaces that haven't been opened yet // return a size of 0. We need to set them to default diff --git a/devices/wim/config/ags/js/overview/main.js b/devices/wim/config/ags/js/overview/main.js index 9c7ab39..287aebf 100644 --- a/devices/wim/config/ags/js/overview/main.js +++ b/devices/wim/config/ags/js/overview/main.js @@ -75,7 +75,7 @@ export const Overview = () => { `, }), - // TODO: throttle his? + // TODO: throttle this? setup: (self) => { self.on('get-child-position', (_, ch) => { if (ch === mainBox) {