diff --git a/src/widget/Notification.tsx b/src/widget/Notification.tsx index 6a0cd5c..cc4cd8e 100644 --- a/src/widget/Notification.tsx +++ b/src/widget/Notification.tsx @@ -9,6 +9,7 @@ import GObject from "ags/gobject"; import AstalNotifd from "gi://AstalNotifd"; import Pango from "gi://Pango?version=1.0"; import GLib from "gi://GLib?version=2.0"; +import { timeout } from "ags/time"; function getNotificationImage(notif: AstalNotifd.Notification|HistoryNotification): (string|undefined) { @@ -58,7 +59,9 @@ export function NotificationWidget({ notification, actionClicked, holdOnHover, s eventControllerMotion.connect("enter", () => holdOnHover && Notifications.getDefault().holdNotification(notification.id)), eventControllerMotion.connect("leave", () => - holdOnHover && notification && Notifications.getDefault().removeNotification(notification.id)) + holdOnHover && notification && timeout(600, () => + Notifications.getDefault().removeNotification(notification.id) + )) ]); conns.set(gestureClick, [ diff --git a/src/window/FloatingNotifications.tsx b/src/window/FloatingNotifications.tsx index 7621f48..bbad256 100644 --- a/src/window/FloatingNotifications.tsx +++ b/src/window/FloatingNotifications.tsx @@ -21,13 +21,9 @@ export const FloatingNotifications = (mon: number) => - {/* - Why is holdOnHover disabled: the shell for some reason crashes - when removing the notification on hover-lost 💔 - */} Notifications.getDefault().removeNotification(notif)} - holdOnHover={false} actionClicked={() => { + holdOnHover actionClicked={() => { const viewAction = notif.actions.filter(a => a.id.toLowerCase() === "view" || a.label.toLowerCase() === "view"