fix(ags): add idle in perMonitor
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-11-18 22:35:28 -05:00
parent 155a9884ee
commit b1eeb4308d

View file

@ -1,3 +1,4 @@
import { idle } from 'astal';
import { App, Gdk, Gtk } from 'astal/gtk3';
import AstalHyprland from 'gi://AstalHyprland';
@ -120,7 +121,7 @@ export const closeAll = () => {
});
};
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<Gdk.Monitor, Gtk.Widget>();
@ -144,4 +145,4 @@ export const perMonitor = (window: (monitor: Gdk.Monitor) => Gtk.Widget) => {
windows.get(monitor)?.destroy();
windows.delete(monitor);
});
};
});