From b1eeb4308db06e2e353bb4f4fb718e1fb398fceb Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 18 Nov 2024 22:35:28 -0500 Subject: [PATCH] fix(ags): add idle in perMonitor --- nixosModules/ags/config/lib.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nixosModules/ags/config/lib.ts b/nixosModules/ags/config/lib.ts index e23b29e6..153ef72e 100644 --- a/nixosModules/ags/config/lib.ts +++ b/nixosModules/ags/config/lib.ts @@ -1,3 +1,4 @@ +import { idle } from 'astal'; import { App, Gdk, Gtk } from 'astal/gtk3'; import AstalHyprland from 'gi://AstalHyprland'; @@ -113,14 +114,14 @@ export const centerCursor = (): void => { export const closeAll = () => { (App.get_windows() as PopupWindow[]) .filter((w) => w && - w.close_on_unfocus && - w.close_on_unfocus !== 'stay') + w.close_on_unfocus && + w.close_on_unfocus !== 'stay') .forEach((w) => { App.get_window(w.name)?.set_visible(false); }); }; -export const perMonitor = (window: (monitor: Gdk.Monitor) => Gtk.Widget) => { +export const perMonitor = (window: (monitor: Gdk.Monitor) => Gtk.Widget) => idle(() => { const display = Gdk.Display.get_default(); const windows = new Map(); @@ -144,4 +145,4 @@ export const perMonitor = (window: (monitor: Gdk.Monitor) => Gtk.Widget) => { windows.get(monitor)?.destroy(); windows.delete(monitor); }); -}; +});