Skip to content

gtktext: Claim gesture more selectively

Carlos Garnacho requested to merge wip/carlosg/osk-activation into main

Even though button 1 (or touch down) presses do most often have an effect in one way or another (starting drag, moving focus, starting selection, ...), there is one situation that they do immediately nothing: When clicking on the entry does not move the text caret around. Dragging might start a selection, but the entry did not do anything just yet, and an immediate button/touch release should remain at "did nothing".

And that is precisely the hint that the Wayland IM context's click gesture takes, clicks that do not scroll nor move the caret around, having the GtkText not claim the gesture in that situation makes the IM gesture able to do its thing without in-fighting.

This is typically not a problem when the GtkText is embedded in another GtkEditable implementation (e.g. GtkEntry), since the IM gesture is inactive and capturing from the parent widget, so gets a pass that it otherwise doesn't get when both gestures are in the same widget. This makes it work regardless of GtkText not being a child of a composite widget, like NautilusQueryEditor and AdwRowEntry.

Closes: #5351 (closed)

Merge request reports