From 882627cc5eea76b2e292aa814574dc002769cb2e Mon Sep 17 00:00:00 2001 From: matt1432 Date: Thu, 14 Sep 2023 13:26:42 -0400 Subject: [PATCH] fix(ags): don't remove hovered notifications in popups --- config/ags/config.js | 1 + config/ags/js/notifications/base.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/config/ags/config.js b/config/ags/config.js index 6407d03..d2e4380 100644 --- a/config/ags/config.js +++ b/config/ags/config.js @@ -18,6 +18,7 @@ exec(`bash -c "$AGS_PATH/startup.sh"`); export default { style: css, + notificationPopupTimeout: 5000, windows: [ Powermenu, Bar, diff --git a/config/ags/js/notifications/base.js b/config/ags/js/notifications/base.js index e40f8e9..7f64932 100644 --- a/config/ags/js/notifications/base.js +++ b/config/ags/js/notifications/base.js @@ -54,6 +54,20 @@ const NotificationIcon = ({ appEntry, appIcon, image }) => { export default ({ id, summary, body, actions, urgency, time, ...icon }) => Draggable({ maxOffset: 200, command: () => Notifications.close(id), + properties: [['hovered', false]], + onHover: w => { + if (w._hovered) + return; + + timeout(300, () => w._hovered = true); + }, + onHoverLost: w => { + if (!w._hovered) + return; + + w._hovered = false; + Notifications.dismiss(id); + }, child: Box({ className: `notification ${urgency}`,