You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[GTK4] Manage propagation for gesture events and fix popup menus
For e.g. the text widget, a default pop-up menu if provided by GTK and
activated, unless a custom menu is set within SWT. To avoid both menus
being shown at the same time, the event must be consumed when showing
the SWT menu.
In GTK3, this is done by returning TRUE in the callback method, which is
no longer possible in GTK4. Instead, the event needs to be marked as
"claimed" via gtk_gesture_set_sequence_state(), to prevent other, native
listeners from processing it as well.
To do so, the gtk_gesture_press_event() and gtk_gesture_release_event()
have been adapted to now return an integer, which may be one of the
following values:
- GTK_EVENT_SEQUENCE_NONE
- GTK_EVENT_SEQUENCE_CLAIMED
- GTK_EVENT_SEQUENCE_DENIED
For example, the value should be GTK_EVENT_SEQUENCE_CLAIMED after the
menu is shown.
Note: It is not possible to always claim an event as "claimed", as it
would then prevent the default value from being shown at all, even if no
SWT menu is set.
Additionally, the check for whether a menu can be shown has been
inverted ((state & MENU) != 0), to match the GTK3 logic. Because this
bit is always set, this effectively stops all SWT menus from being
shown.
0 commit comments