[gtk/shortcuts-rebased-again: 119/124] Set names on shortcut controllers
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/shortcuts-rebased-again: 119/124] Set names on shortcut controllers
- Date: Fri, 21 Jun 2019 03:27:10 +0000 (UTC)
commit 010b36e84bc9bf4c9d0a9e0ca82a18d22f68d2c1
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Jun 19 11:10:40 2019 +0000
Set names on shortcut controllers
gtk/gtklabel.c | 1 +
gtk/gtkwidget.c | 3 +++
gtk/gtkwindow.c | 5 +++++
3 files changed, 9 insertions(+)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 2bd58728d8..b37108efd3 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -1798,6 +1798,7 @@ gtk_label_setup_mnemonic (GtkLabel *label)
if (priv->mnemonic_controller == NULL)
{
priv->mnemonic_controller = gtk_shortcut_controller_new ();
+ gtk_event_controller_set_name (priv->mnemonic_controller, "mnemonic");
gtk_event_controller_set_propagation_phase (priv->mnemonic_controller, GTK_PHASE_CAPTURE);
gtk_shortcut_controller_set_scope (GTK_SHORTCUT_CONTROLLER (priv->mnemonic_controller),
GTK_SHORTCUT_SCOPE_MANAGED);
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index f683149eb7..b0bc184569 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -2880,11 +2880,13 @@ gtk_widget_init (GTypeInstance *instance, gpointer g_class)
model = gtk_concat_model_new (GTK_TYPE_SHORTCUT);
g_object_set_data_full (G_OBJECT (widget), "gtk-shortcut-manager-bubble", model, g_object_unref);
controller = gtk_shortcut_controller_new_for_model (G_LIST_MODEL (model));
+ gtk_event_controller_set_name (controller, "shortcut manager bubble");
gtk_widget_add_controller (widget, controller);
model = gtk_concat_model_new (GTK_TYPE_SHORTCUT);
g_object_set_data_full (G_OBJECT (widget), "gtk-shortcut-manager-capture", model, g_object_unref);
controller = gtk_shortcut_controller_new_for_model (G_LIST_MODEL (model));
+ gtk_event_controller_set_name (controller, "shortcut manager capture");
gtk_event_controller_set_propagation_phase (controller, GTK_PHASE_CAPTURE);
gtk_widget_add_controller (widget, controller);
}
@@ -2894,6 +2896,7 @@ gtk_widget_init (GTypeInstance *instance, gpointer g_class)
gtk_widget_set_layout_manager (widget, g_object_new (layout_manager_type, NULL));
controller = gtk_shortcut_controller_new_for_model (G_LIST_MODEL (GTK_WIDGET_CLASS
(g_class)->priv->shortcuts));
+ gtk_event_controller_set_name (controller, "class shortcuts");
gtk_widget_add_controller (widget, controller);
}
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index b0330c7583..bc43667c8f 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1876,6 +1876,7 @@ gtk_window_init (GtkWindow *window)
priv->key_controller = gtk_event_controller_key_new ();
gtk_event_controller_set_propagation_phase (priv->key_controller, GTK_PHASE_CAPTURE);
+ gtk_event_controller_set_name (priv->key_controller, "window focus");
g_signal_connect_swapped (priv->key_controller, "focus-in",
G_CALLBACK (gtk_window_focus_in), window);
g_signal_connect_swapped (priv->key_controller, "focus-out",
@@ -1887,6 +1888,7 @@ gtk_window_init (GtkWindow *window)
gtk_widget_add_controller (widget, priv->key_controller);
controller = gtk_shortcut_controller_new ();
+ gtk_event_controller_set_name (controller, "window menubar");
gtk_event_controller_set_propagation_phase (controller, GTK_PHASE_CAPTURE);
shortcut = gtk_shortcut_new (gtk_keyval_trigger_new (MENU_BAR_ACCEL, 0),
@@ -3089,6 +3091,9 @@ gtk_window_set_application (GtkWindow *window,
app_accels = gtk_application_get_application_accels (priv->application);
priv->application_shortcut_controller = gtk_shortcut_controller_new_for_model
(gtk_application_accels_get_shortcuts (app_accels));
+ g_object_set (priv->application_shortcut_controller,
+ "name", "application shortcuts",
+ NULL);
gtk_event_controller_set_propagation_phase (priv->application_shortcut_controller,
GTK_PHASE_CAPTURE);
gtk_shortcut_controller_set_scope (GTK_SHORTCUT_CONTROLLER
(priv->application_shortcut_controller), GTK_SHORTCUT_SCOPE_GLOBAL);
gtk_widget_add_controller (GTK_WIDGET (window), priv->application_shortcut_controller);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]