Allow setting alternate parent for GtkActionMuxer action resolution
One of the things that has always been difficult in GTK with the advent of actions is resolving actions when they happen on a sibling widget. For example, you may have actions in a headerbar that are related to things in the content area of the window. Or for document editing, you might have a sidebar that contains formatting tools for the document.
Generally, this has meant you have to proxy all of the GActionGroup
s so that the widgets not sharing hierarchy can have access. In practice, this has caused a significant number of crashes in Builder with GTK 3 and I don't have the heart to go for that design again GTK 4, especially since we can no longer list or retrieve action groups for a widget.
What would be nice, instead, is if could alter the action hierarchy for a widget so that it resolves actions through another path than it's GtkWidget
parent.
For example, let me just strawman some API.
void gtk_widget_set_action_parent (GtkWidget *widget,
GtkWidget *action_parent);
In this case, the muxer would be updated to use action_parent
instead of gtk_widget_get_parent(widget)
.
Anyway, after a lot of thought on how to make this better for GTK 4, this is the smallest API addition I could think of.