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 732143 - ClutterDropAction "drop" signal not emitted
ClutterDropAction "drop" signal not emitted
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: ClutterAction
1.18.x
Other Linux
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2014-06-24 02:11 UTC by Sunjin Yang
Modified: 2014-06-26 00:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
drop-action: Use the right state for events (1.97 KB, patch)
2014-06-25 14:19 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review

Description Sunjin Yang 2014-06-24 02:11:15 UTC
Hello,

I'm Arch Linux user using Clutter 1.18.2 version.

examples/drop-action.c in Clutter source tree doesn't work properly, because "drop" signal is not emitted from ClutterDropAction.

it works properly in Clutter 1.16 version, so I checked clutter-drop-action.c and have found that CLUTTER_BUTTON1_MASK is not set for CLUTTER_BUTTON_RELEASE event.

In my case, reverting the following commit is the solution.

commit c2b0b9aace969ecb19e703c8d53d157eb1072559
Author: Jasper St. Pierre <jstpierre@mecheye.net>
Date:   Tue Nov 12 15:10:22 2013 -0500

    input-device-xi2: Calculate the correct state for button events
    
    The state that the X server sends for button events, by specification,
    contains the button state before the event. We need to synthesize in
    the result of the event in order to determine what the current button
    state is.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=712322

But, I don't know what is the exact solution for this problem.
Comment 1 Emmanuele Bassi (:ebassi) 2014-06-25 14:19:20 UTC
Created attachment 279224 [details] [review]
drop-action: Use the right state for events

The 'state' field should be used for pointer events without button
information. Pointer events that have button information should use
the 'button' field.
Comment 2 Emmanuele Bassi (:ebassi) 2014-06-25 15:06:12 UTC
thanks for the bug report.

the bug is actually in the DropAction: it's using the event state to check if the pointer event has a button mask set, but in reality what we get from the windowing system is the old state, but Clutter provides the new one. bug 712322 addressed this inconsistency in Clutter's implementation. to be fair, the whole issue is pretty fuzzy, especially given the impedance mismatch between supported windowing systems.

in any case, while checking the event state is needed for the MOTION event, the BUTTON_RELEASE event has the button information directly in the structure. we should use the right field for each pointer event.

while we figure out what can we do to avoid breakage at the event handling level, let me address the DropAction regression.
Comment 3 Sunjin Yang 2014-06-26 00:27:55 UTC
Thanks for your work.

Have you any plan to apply this patch in next stable 1.18.x release?
Comment 4 Emmanuele Bassi (:ebassi) 2014-06-26 00:29:59 UTC
yes; I kept the bug open for that while I was spinning the 1.19.4 snapshot.

after talking to Jasper, we came to the conclusion that the previous behaviour was buggy: the commit you linked brings the XInput2 backend on par with what the core Xlib code does.
Comment 5 Emmanuele Bassi (:ebassi) 2014-06-26 00:33:47 UTC
Attachment 279224 [details] pushed as 6eafd62 - drop-action: Use the right state for events