aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/notification-menuitem.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/notification-menuitem.c b/src/notification-menuitem.c
index 9e3c029..df510bd 100644
--- a/src/notification-menuitem.c
+++ b/src/notification-menuitem.c
@@ -19,6 +19,7 @@ enum {
static void notification_menuitem_class_init(NotificationMenuItemClass *klass);
static void notification_menuitem_init(NotificationMenuItem *self);
+static void notification_activated_cb(GtkMenuItem *menuitem, gpointer user_data);
static gboolean notification_button_press_cb(GtkWidget *widget, GdkEventButton *event, gpointer user_data);
static gboolean notification_button_release_cb(GtkWidget *widget, GdkEventButton *event, gpointer user_data);
@@ -69,6 +70,7 @@ notification_menuitem_init(NotificationMenuItem *self)
gtk_container_add(GTK_CONTAINER(self), hbox);
gtk_widget_show(hbox);
+ g_signal_connect(self, "activate", G_CALLBACK(notification_activated_cb), NULL);
g_signal_connect(self, "button-press-event", G_CALLBACK(notification_button_press_cb), NULL);
g_signal_connect(self, "button-release-event", G_CALLBACK(notification_button_release_cb), NULL);
}
@@ -105,6 +107,21 @@ notification_menuitem_set_from_notification(NotificationMenuItem *self, Notifica
}
/**
+ * notification_activated_cb:
+ * @menuitem: the menuitem
+ * @user_data: not used
+ *
+ * Emit a clicked event for the case where a keyboard activates a menuitem.
+ **/
+static void
+notification_activated_cb(GtkMenuItem *menuitem, gpointer user_data)
+{
+ g_return_if_fail(IS_NOTIFICATION_MENUITEM(menuitem));
+
+ g_signal_emit(NOTIFICATION_MENUITEM(menuitem), notification_menuitem_signals[CLICKED], 0);
+}
+
+/**
* notification_button_press_cb:
* @widget: the menuitem
* @event: the button press event