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 681074 - Call clutter_input_device_update_from_event from clutter_x11_handle_event
Call clutter_input_device_update_from_event from clutter_x11_handle_event
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2012-08-02 14:26 UTC by Tomeu Vizoso
Modified: 2012-08-16 11:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Call clutter_input_device_update_from_event from clutter_x11_handle_event (1.06 KB, patch)
2012-08-02 14:26 UTC, Tomeu Vizoso
none Details | Review
device-manager: Update touchpad and touchscreen devices (1.07 KB, patch)
2012-08-15 15:35 UTC, Emmanuele Bassi (:ebassi)
none Details | Review
Associate the device to a stage on touch events (1.53 KB, patch)
2012-08-15 16:21 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review

Description Tomeu Vizoso 2012-08-02 14:26:16 UTC
As per the API docs for clutter_input_device_update_from_event, it should
be called right after creating the ClutterEvent and before emitting it.
Comment 1 Tomeu Vizoso 2012-08-02 14:26:18 UTC
Created attachment 220153 [details] [review]
Call clutter_input_device_update_from_event from clutter_x11_handle_event
Comment 2 Emmanuele Bassi (:ebassi) 2012-08-15 09:27:41 UTC
devices are updated when the event is being processed by the stage, not when the event is translated - since we do event compression and we also inject events into the queue at that point. the API documentation is for toolkit embedding Clutter - not for Clutter itself.

I need more context than "this is needed because the API says so": I know what the API documentation says, I wrote both the function and the documentation that comes with it.
Comment 3 Tomeu Vizoso 2012-08-15 15:03:49 UTC
It's because of Mutter, which calls clutter_x11_handle_event. In a recent commit a few weeks ago (9e02ef459), touch events stopped flowing within Mutter because we started using _clutter_input_device_update instead of always calling _clutter_stage_do_pick.
Comment 4 Emmanuele Bassi (:ebassi) 2012-08-15 15:35:20 UTC
the reason why the ClutterInputDevice is not updated is because the DeviceManager will only update pointer devices and ignore touch devices - something that I forgot to add when I introduced XI2.2 support.
Comment 5 Emmanuele Bassi (:ebassi) 2012-08-15 15:35:31 UTC
Created attachment 221274 [details] [review]
device-manager: Update touchpad and touchscreen devices

We are also interested in keeping their state updated.
Comment 6 Emmanuele Bassi (:ebassi) 2012-08-15 15:36:24 UTC
mmh, no, that's not enough - DeviceManager.update_devices() is not used.
Comment 7 Emmanuele Bassi (:ebassi) 2012-08-15 16:21:00 UTC
Created attachment 221279 [details] [review]
Associate the device to a stage on touch events

Just like we do for crossing events, we need to update the stage pointer
inside ClutterInputDevice on TOUCH_BEGIN and TOUCH_END.
Comment 8 Emmanuele Bassi (:ebassi) 2012-08-16 11:24:29 UTC
Attachment 221279 [details] pushed as 803b3ba - Associate the device to a stage on touch events