diff options
| author | Victor Kareh <[email protected]> | 2025-09-19 18:07:47 -0400 |
|---|---|---|
| committer | Victor Kareh <[email protected]> | 2026-05-27 15:57:48 -0400 |
| commit | 3cb2d940542ac9a014223350ef18d1cf6a0ed1fb (patch) | |
| tree | de6a045cfff2c33ea309f06c51bf86c9cf6f27c3 | |
| parent | cb5ec33bbb7d609ae8f85252f1903e3b64b3f75c (diff) | |
| download | mate-notification-daemon-3cb2d940542ac9a014223350ef18d1cf6a0ed1fb.tar.bz2 mate-notification-daemon-3cb2d940542ac9a014223350ef18d1cf6a0ed1fb.tar.xz | |
capplet: Add DBus 'activate' callback
This allows us to open the notifications history through DBus, which
means we could configure a keybinding for it.
| -rw-r--r-- | src/capplet/mate-notification-applet.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/capplet/mate-notification-applet.c b/src/capplet/mate-notification-applet.c index d6620b7..8d1f6c7 100644 --- a/src/capplet/mate-notification-applet.c +++ b/src/capplet/mate-notification-applet.c @@ -345,6 +345,24 @@ toggle_do_not_disturb (MateNotificationApplet *applet) g_settings_set_boolean (applet->settings, GSETTINGS_KEY_DO_NOT_DISTURB, !current_state); } +static gboolean +notification_applet_activate (MatePanelApplet *applet_widget, + const gchar *action, + guint32 timestamp, + MateNotificationApplet *applet) +{ + if (g_strcmp0 (action, "show-history") == 0) { + if (applet->history_context) { + show_notification_history (applet->history_context); + } + return TRUE; + } else if (g_strcmp0 (action, "toggle-dnd") == 0) { + toggle_do_not_disturb (applet); + return TRUE; + } + return FALSE; +} + static void update_count_badge (MateNotificationApplet *applet) { @@ -449,6 +467,10 @@ applet_main (MatePanelApplet *applet_widget) g_signal_connect (G_OBJECT (applet_widget), "button-press-event", G_CALLBACK (applet_button_press_cb), applet); + /* D-Bus activation handling */ + g_signal_connect (G_OBJECT (applet_widget), "activate", + G_CALLBACK (notification_applet_activate), applet); + /* set up context menu */ applet->action_group = gtk_action_group_new ("Notification Status Actions"); #ifdef ENABLE_NLS |
