From f2e5e5b03f619745967e4bd7cfa1fd08f2b89bd0 Mon Sep 17 00:00:00 2001 From: kramo Date: Sun, 24 Mar 2024 16:19:24 +0100 Subject: [PATCH] Improve notifications for GNOME 46 --- cartridges/main.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cartridges/main.py b/cartridges/main.py index 2b6b9af..ccb0dd7 100644 --- a/cartridges/main.py +++ b/cartridges/main.py @@ -201,12 +201,15 @@ class CartridgesApplication(Adw.Application): return 1 self.register() - notification = Gio.Notification.new(_("Cartridges")) - notification.set_body(_("{} launched").format(name)) self.send_notification( - "launch", - notification, + "launch", Gio.Notification.new(_("{} launched").format(name)) ) + + # Sleep for 6 seconds before withdrawing the notification + # The amount a notification stays up is ~5, so leave an extra second for the animation + GLib.usleep(6000000) + self.withdraw_notification("launch") + return 0 return -1