Skip to content

osk-widget: manually retrieve event coordinates

The GdkGesture callbacks somehow lose the fractional component of the coordinates. On even 1080p phones where a scale factor of 3 is used this loss of accuracy can make the typing cursor controls extremely frustrating to use.

The fractional component can be recovered by fetching the pointer device via the gesture event and reading it's coordinates. Fetching the device directly from the gesture does not contain the coordinates.

I think this is a known issue, although I couldn't find anything on the GTK issue tracker in a brief search...

The implementation I have here is absolutely a big hack, I'm not at all familiar with GTK/GDK, so possibly there's also a better way to accomplish this.

If it makes sense and this solution can be used elsewhere, I'd be happy to try and come up with a wrapper for the GtkGesture object that could be put into some common library, or maybe have a go at fixing it upstream...

Merge request reports