diff options
Diffstat (limited to 'src/modules/notifpopups.tsx')
| -rw-r--r-- | src/modules/notifpopups.tsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/modules/notifpopups.tsx b/src/modules/notifpopups.tsx index 5da3092..9e34549 100644 --- a/src/modules/notifpopups.tsx +++ b/src/modules/notifpopups.tsx @@ -1,4 +1,4 @@ -import { Astal, Gtk } from "astal/gtk3"; +import { App, Astal, Gtk } from "astal/gtk3"; import AstalNotifd from "gi://AstalNotifd"; import { notifpopups as config } from "../../config"; import { setupChildClickthrough } from "../utils/widgets"; @@ -16,7 +16,11 @@ export default () => ( setup={self => { const notifd = AstalNotifd.get_default(); const map = new Map<number, Notification>(); + let notifsOpen = false; + self.hook(notifd, "notified", (self, id) => { + if (notifsOpen) return; + const notification = notifd.get_notification(id); const popup = (<Notification popup notification={notification} />) as Notification; @@ -41,6 +45,10 @@ export default () => ( }); self.hook(notifd, "resolved", (_, id) => map.get(id)?.destroyWithAnims()); + self.hook(App, "window-toggled", (_, window) => { + if (window.name === "notifications") notifsOpen = window.visible; + }); + // Change input region to child region so can click through empty space setupChildClickthrough(self); }} |