How to detect a double-click of a GtkToggleButton in gtk4?

The obvious solution is to attach a GtkGestureClick, but it never receives the double click event, because the event sequence is claimed by the GtkGestureClick internal to the GtkToggleButton as soon as the first button press is released.

This is needed for a long-standing feature where double-clicking a tool brings up the tool-specific preferences in Inkscape:

You can try adding a GtkGestureClick event controller, and set the propagation phase to GTK_PHASE_CAPTURE.

1 Like

Thank you, this works, in fact I would have already tried it if I hadn’t ruled it out based on wrong reasons (see above).