From b0f857f0d1a1bec3d9c56a6e76d54932bfc6bf01 Mon Sep 17 00:00:00 2001
From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Date: Tue, 8 Apr 2025 16:01:36 +1000
Subject: feat: add navbar

For controlling sidebar panes + other stuff later
---
 src/modules/notifpopups.tsx | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

(limited to 'src/modules/notifpopups.tsx')

diff --git a/src/modules/notifpopups.tsx b/src/modules/notifpopups.tsx
index 57e2a64..c8f4e13 100644
--- a/src/modules/notifpopups.tsx
+++ b/src/modules/notifpopups.tsx
@@ -1,11 +1,11 @@
 import type { Monitor } from "@/services/monitors";
-import { idle, timeout } from "astal";
-import { App, Astal, Gtk } from "astal/gtk3";
+import { setupChildClickthrough } from "@/utils/widgets";
+import Notification from "@/widgets/notification";
+import { Astal, Gtk } from "astal/gtk3";
 import { notifpopups as config } from "config";
 import AstalNotifd from "gi://AstalNotifd";
-import { setupChildClickthrough } from "../utils/widgets";
-import Notification from "../widgets/notification";
 import type SideBar from "./sidebar";
+import { awaitSidebar } from "./sidebar";
 
 export default ({ monitor }: { monitor: Monitor }) => (
     <window
@@ -61,13 +61,8 @@ export default ({ monitor }: { monitor: Monitor }) => (
                 });
                 self.hook(notifd, "resolved", (_, id) => map.get(id)?.destroyWithAnims());
 
-                let sidebar: SideBar | null;
-
-                const awaitSidebar = () => {
-                    sidebar = App.get_window(`sidebar${monitor.id}`) as SideBar | null;
-                    if (!sidebar) timeout(100, awaitSidebar);
-                };
-                idle(awaitSidebar);
+                let sidebar: SideBar | null = null;
+                awaitSidebar(monitor).then(s => (sidebar = s));
 
                 // Change input region to child region so can click through empty space
                 setupChildClickthrough(self);
-- 
cgit v1.2.3-freya

