From c4fee015d64b63262cae2bcfe64182afdc744e17 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sat, 28 Oct 2023 18:47:39 -0400 Subject: [PATCH] feat(ags notifs): disable eventbox when sliding away --- devices/wim/config/ags/js/notifications/center.js | 6 +++++- devices/wim/config/ags/js/notifications/gesture.js | 10 ++++++++-- devices/wim/config/ags/js/notifications/popup.js | 9 ++++----- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/devices/wim/config/ags/js/notifications/center.js b/devices/wim/config/ags/js/notifications/center.js index 026f771d..bb13c0f9 100644 --- a/devices/wim/config/ags/js/notifications/center.js +++ b/devices/wim/config/ags/js/notifications/center.js @@ -12,11 +12,14 @@ const ClearButton = () => EventBox({ onPrimaryClickRelease: button => { button._popups.children.forEach(ch => { ch.child.setStyle(ch.child._leftAnim1); + ch.sensitive = false; }); button._notifList.children.forEach(ch => { - if (ch.child) + if (ch.child) { ch.child.setStyle(ch.child._rightAnim1); + ch.sensitive = false; + } timeout(500, () => { button._notifList.remove(ch); Notifications.clear(); @@ -91,6 +94,7 @@ const NotificationList = Box({ for (const ch of box.children) { if (ch._id == id) { ch.child.setStyle(ch.child._rightAnim1); + ch.sensitive = false; timeout(500, () => box.remove(ch)); return; } diff --git a/devices/wim/config/ags/js/notifications/gesture.js b/devices/wim/config/ags/js/notifications/gesture.js index dbba73d9..a04765d3 100644 --- a/devices/wim/config/ags/js/notifications/gesture.js +++ b/devices/wim/config/ags/js/notifications/gesture.js @@ -113,11 +113,17 @@ export default ({ if (Math.abs(offset) > maxOffset) { if (offset > 0) { self.setStyle(rightAnim1); - Utils.timeout(500, () => self.setStyle(rightAnim2)); + widget.sensitive = false; + Utils.timeout(500, () => { + self.setStyle(rightAnim2); + }); } else { self.setStyle(leftAnim1); - Utils.timeout(500, () => self.setStyle(leftAnim2)); + widget.sensitive = false; + Utils.timeout(500, () => { + self.setStyle(leftAnim2); + }); } Utils.timeout(1000, () => { command(); diff --git a/devices/wim/config/ags/js/notifications/popup.js b/devices/wim/config/ags/js/notifications/popup.js index 37967f80..9ca0fead 100644 --- a/devices/wim/config/ags/js/notifications/popup.js +++ b/devices/wim/config/ags/js/notifications/popup.js @@ -19,12 +19,11 @@ const Popups = () => Box({ box.get_parent().reveal_child = false; Utils.timeout(200, () => { - if (box._map.get(id)?.interval) { - GLib.source_remove(box._map.get(id).interval); - box._map.get(id).interval = undefined; + const notif = box._map.get(id); + if (notif.interval) { + GLib.source_remove(notif.interval); + notif.interval = undefined; } - box._map.get(id)?.destroy(); - box._map.delete(id); }); }],