aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/application.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-12-30 20:22:14 +0100
committerfiaxh <git@lightrise.org>2020-12-30 20:30:35 +0100
commit99e98ac8d97296b0a34351d3bc8b155b0c8fc6db (patch)
treed5274576a0b7cb1257db52937e14e1b0e8a0f6bd /main/src/ui/application.vala
parentc454bd904d1b9641ed333b71e206bd253fb9e9df (diff)
downloaddino-99e98ac8d97296b0a34351d3bc8b155b0c8fc6db.tar.gz
dino-99e98ac8d97296b0a34351d3bc8b155b0c8fc6db.zip
Set window urgency hint independent of notification setting
fixes #960
Diffstat (limited to 'main/src/ui/application.vala')
-rw-r--r--main/src/ui/application.vala15
1 files changed, 13 insertions, 2 deletions
diff --git a/main/src/ui/application.vala b/main/src/ui/application.vala
index 008b15c7..29b61357 100644
--- a/main/src/ui/application.vala
+++ b/main/src/ui/application.vala
@@ -28,11 +28,22 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application {
create_actions();
startup.connect(() => {
- stream_interactor.get_module(NotificationEvents.IDENTITY).register_notification_provider(new GNotificationsNotifier(stream_interactor));
+ NotificationEvents notification_events = stream_interactor.get_module(NotificationEvents.IDENTITY);
+ notification_events.register_notification_provider(new GNotificationsNotifier(stream_interactor));
FreeDesktopNotifier? free_desktop_notifier = FreeDesktopNotifier.try_create(stream_interactor);
if (free_desktop_notifier != null) {
- stream_interactor.get_module(NotificationEvents.IDENTITY).register_notification_provider(free_desktop_notifier);
+ notification_events.register_notification_provider(free_desktop_notifier);
}
+ notification_events.notify_content_item.connect((content_item, conversation) => {
+ // Set urgency hint also if (normal) notifications are disabled
+ // Don't set urgency hint in GNOME, produces "Window is active" notification
+ var desktop_env = Environment.get_variable("XDG_CURRENT_DESKTOP");
+ if (desktop_env == null || !desktop_env.down().contains("gnome")) {
+ if (this.active_window != null) {
+ this.active_window.urgency_hint = true;
+ }
+ }
+ });
});
activate.connect(() => {