summaryrefslogtreecommitdiff
path: root/src/modules/notifpopups.tsx
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-01-16 18:47:23 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-01-16 18:47:23 +1100
commited05e9af2515c3c1c09becae5b405fc5074aa5e9 (patch)
treeac6d4e9e4262b79d6eec4ce64ffd351d8ba4d315 /src/modules/notifpopups.tsx
parentrefactor: move ts to src (diff)
downloadcaelestia-shell-ed05e9af2515c3c1c09becae5b405fc5074aa5e9.tar.gz
caelestia-shell-ed05e9af2515c3c1c09becae5b405fc5074aa5e9.tar.bz2
caelestia-shell-ed05e9af2515c3c1c09becae5b405fc5074aa5e9.zip
notifications: make popup window
Diffstat (limited to 'src/modules/notifpopups.tsx')
-rw-r--r--src/modules/notifpopups.tsx10
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);
}}