forked from AuroraMiddleware/gtk
Add two users of gtk_widget_insert_action_group
Each GtkWindow with an associated GtkApplication should add this as "app" to its action context. Each GtkApplicationWindow is its own GActionGroup, and it should add itself to itself with the prefix "win". There is now some duplication here because we have the new GActionMuxer hierarchy managed by GtkWidget, but GtkApplicationWindow still carries its own muxer. The redundancy will be removed in a future patch.
This commit is contained in:
parent
652f16dd98
commit
ab3b41374a
@ -959,6 +959,8 @@ gtk_application_window_init (GtkApplicationWindow *window)
|
||||
window->priv->accels = gtk_accel_group_new ();
|
||||
gtk_window_add_accel_group (GTK_WINDOW (window), window->priv->accels);
|
||||
|
||||
gtk_widget_insert_action_group (GTK_WIDGET (window), "win", G_ACTION_GROUP (window->priv->actions));
|
||||
|
||||
/* window->priv->actions is the one and only ref on the group, so when
|
||||
* we dispose, the action group will die, disconnecting all signals.
|
||||
*/
|
||||
|
@ -2820,6 +2820,9 @@ gtk_window_set_application (GtkWindow *window,
|
||||
gtk_application_add_window (priv->application, window);
|
||||
}
|
||||
|
||||
/* don't use a normal cast: application may be NULL */
|
||||
gtk_widget_insert_action_group (GTK_WIDGET (window), "app", (GActionGroup *) application);
|
||||
|
||||
g_object_notify (G_OBJECT (window), "application");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user