Cook up some silly cases to test out the hidden-when='' attribute.
- make sure hidden-when='action-missing' shows/hides items based on
actions being created and destroyed
- make sure hidden-when='action-disabled' shows/hides items based on
actions being enabled and disabled
- make sure hidden-when='action-missing' doesn't hide items when the
action is merely disabled
https://bugzilla.gnome.org/show_bug.cgi?id=688421
Modify the tracker so that it manages the visibility of
GtkMenuTrackerItem by issuing insert and remove callbacks to the
user of the tracker.
This works by treating the GtkMenuTrackerItem as a virtual section which
contains 1 item when the item is visible and 0 items when it is hidden.
For efficiency reasons, we only employ this trick in the case that the
item has a hidden-when='' attribute set on it.
https://bugzilla.gnome.org/show_bug.cgi?id=688421
Add an internal API for checking if a GtkMenuTrackerItem is visible,
along with a signal for reporting changes in that flag. The item will
become invisible in situations according to the new hidden-when=''
attribute, which can be set to 'action-disabled' or 'action-missing'.
This new flag doesn't actually do anything yet, and none of the
consumers of GtkMenuTracker do anything with it (nor should they). A
followup patch will address the issue.
https://bugzilla.gnome.org/show_bug.cgi?id=688421
Refactor the code in the action observer remove function in order to
make way for the (efficient) handling of hiding of the item in the case
that hidden-when='' is given.
https://bugzilla.gnome.org/show_bug.cgi?id=688421
Strictly speaking, can_activate should always be set back to FALSE when
the action disappears from the muxer (since we can't activate it
anymore) but we forgot to do that.
This 'bug' could never cause a problem because 'can_activate' is never
directly queried for anything at all and the item would get marked
insensitive anyway. As soon as the action was re-added, can_activate
would be recalculated based on the new action before anything else could
happen.
All the same, this should be cleared here.
https://bugzilla.gnome.org/show_bug.cgi?id=688421
Remove a hash lookup from the separator sync logic (which is run every
time we change a menu). Instead, we do the lookup when creating the
section and cache the result.
This refactor will also help us in a future commit to add support for
hiding menu items based on missing actions.
https://bugzilla.gnome.org/show_bug.cgi?id=688421
This adds save/restore calls to the clear-to-transparent call in
the pixel cache, to avoid changing the default color of the
cairo_t. It also removes a call set_operator call that is no longer
necessary (it was trying to manually restore the state).
https://bugzilla.gnome.org/show_bug.cgi?id=721480
The signal callbacks are defined to take pointers as their arguments, but the
callbacks found in testsuite/gtk/builder.c are passing a GParamSpec by value
as the second argument. This confuses and angers the compiler on ppc64el,
resulting in segfaults after return from the function due to stack-smashing
by the (completely-unused) argument.
https://bugzilla.gnome.org/show_bug.cgi?id=721700
GtkApplicationWindow frees its internal action group on dispose for the
usual reasons: to avoid the possibility of reference cycles caused by
actions referring back to the window again.
Unfortunately, if it happens to be inside of a GtkActionMuxer at the
time that it is disposed, it will (eventually) be removed from the muxer
after it has been disposed. Removing an action group from a muxer
involves a call to g_action_group_list_actions() which will crash
because the internal action group to which we normally delegate the call
has been freed.
A future patch that reworks the quartz menu code will introduce a use of
GtkActionMuxer in a way that causes exactly this problem.
We can guard against the problem in a number of ways.
First, we can avoid the entire situation by ensuring that we are removed
from the muxer before we destroy the action group. To this end, we
delay destruction of the action group until after the chain-up to the
dispose of GtkWindow (which is where the window is removed from the
GtkApplication).
Secondly, we can add checks to each of our GActionGroup and GActionMap
implementation functions to check that the internal action group is
still alive before we attempt to delegate to it.
We have to be careful, though: because our _list_actions() call will
suddenly be returning an empty list, people watching the group from
outside will have expected to see "action-removed" calls for the
now-missing items. Make sure we send those. but only if someone is
watching.
https://bugzilla.gnome.org/show_bug.cgi?id=710351
A widget intended to offer contextual actions for a given view.
It allows packing children into the start or end as well as offering
a single centered child box.
https://bugzilla.gnome.org/show_bug.cgi?id=721665
Notifications can only be associated with application actions,
but clear is a window action. Introduce a "clear-all" action
that forwards to clear on all windows.
https://bugzilla.gnome.org/show_bug.cgi?id=721633