Propagation of button press/release events seems to have changed

I’m porting a shell extension to GNOME 49. It has a BoxLayout containing a set of Buttons. The buttons individually handle ‘clicked’ events to do one thing while the BoxLayout handles ‘button-release-event’ for button 3 to do something else.

This has worked nicely for a long time. However, in GNOME 49 the button release doesn’t seem to be propagated from the Button to the BoxLayout, so right-clicking on a button no longer does anything.

I suspect this is related to the recent changes to Button to use ClutterClickGesture (commit dd694bf1a).

Hmm. As a workaround I can use a ‘button-press-event’ in the Buttons.

I have similar issue here tray-icons-reloaded/TrayIndicator.js at master · martinpl/tray-icons-reloaded · GitHub button-release-event is not fired anymore on Shell 49.

I have been having the same problem, but I fixed it by clearing the actions associated with the St.Button using button.clear_actions(). From there, button-press-event and button-release-event work correctly.

1 Like

@Vishram1123 thanks for the fix :slight_smile:

Yes, thanks a lot @Vishram1123 :smiley:

The fix also worked in my extension where the buttons were doing nothing since Gnome 49.