Skip to content

translate GtkEventControllerMotion x,y into widget coordinates

This translates the incoming event x,y position into the coordinate space for the widget we care about. This is useful because it allows consuming widgets to not need to care about where the event landed, and that the coordinates always start from 0,0 relative to that widgets position.

I'm not sure the full correctness on how I'm translating things in get_coords(), so some checking on that would be useful.

I also don't know the right way to do this on gtk4, but I suspect we want something there as well.

This fixes an issue in Dazzle where we use GtkEventControllerMotion to track motion events with a CAPTURE phase to avoid those nasty window-inside-window event trapping issues.

See #1386 (closed) for the related bug.

Edited by Christian Hergert

Merge request reports