After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 791039 - Emit enter+motion after GDK_CROSSING_TOUCH_END leave
Emit enter+motion after GDK_CROSSING_TOUCH_END leave
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Class: GdkDevice
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Carlos Garnacho
Depends on:
Blocks:
 
 
Reported: 2017-11-30 18:26 UTC by Carlos Garnacho
Modified: 2018-05-02 19:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdk: Always emit motion after enter (1.45 KB, patch)
2017-11-30 18:26 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2017-11-30 18:26:22 UTC
After GDK emits a fake GDK_CROSSING_TOUCH_END leave event, it will consume the next motion event entirely and replace it with a GDK_CROSSING_TOUCH_BEGIN/DEVICE_CHANGE enter event.

It would be more consistent with X11 to send both enter+motion, and certainly some clients like spice-gtk rely on this behavior, thus break on these fake touchscreen crossing events. The attached patch ensures both are sent.

This patch is for gtk-3-22 only. It's moot for master since we don't propagate emulated events upwards.
Comment 1 Carlos Garnacho 2017-11-30 18:26:54 UTC
Created attachment 364695 [details] [review]
gdk: Always emit motion after enter

After a pointer emulating GDK_TOUCH_END event triggering a fake leave
notify with GDK_CROSSING_TOUCH_END mode, pointer_under_window will be
unset, which will make the next motion/touch_update event to trigger
an enter notify event again.

Up till there, that's fine, however the motion event is just consumed
in favor of the just synthesized enter notify event. This is unexpected
to clients like spice-gtk that will only update coordinates from motion
events, sending both enter and motion is more consistent with X11 and
will make them happy.
Comment 2 Matthias Clasen 2017-11-30 18:31:24 UTC
I keep thinking that these semantics should be specified somewhere... of course, there's plenty of possible event sequences
Comment 3 Carlos Garnacho 2017-11-30 19:14:07 UTC
Comment on attachment 364695 [details] [review]
gdk: Always emit motion after enter

True... X11 usually does an ok work at consistency, so toolkits wouldn't have to care that much, however things fall apart soon when you want to play along wrt emulation while supporting touch events at the same time :(.

Luckily we now have a better story about handling pointer+touch with GtkGesture, and in master we only send one set of events (touch ones) for this case, which get far simpler than having to propagate both and letting widgets decide which to obey.

And I actually did push the patch... I will double check master is good before closing.
Comment 4 GNOME Infrastructure Team 2018-05-02 19:30:06 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/981.