summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2025-09-19 18:07:47 -0400
committerVictor Kareh <[email protected]>2026-03-17 06:34:48 -0400
commit309032d7bbb89d689bb44e0a0a77514f65477724 (patch)
treef62a4b1520e932f5bd6779c38972cbfc50852111
parente594a931dd892151d5a889d229cd109849ca10e2 (diff)
downloadmate-notification-daemon-dbus-activate.tar.bz2
mate-notification-daemon-dbus-activate.tar.xz
capplet: Add DBus 'activate' callbackdbus-activate
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.c22
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