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 635278 - dnd: call ungrabEvents when the drag actor is destroyed
dnd: call ungrabEvents when the drag actor is destroyed
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-11-19 16:13 UTC by Dan Winship
Modified: 2010-11-19 20:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
dnd: call ungrabEvents when the drag actor is destroyed (2.57 KB, patch)
2010-11-19 16:13 UTC, Dan Winship
accepted-commit_now Details | Review
dnd: fix a case where ungrabEvents wasn't being called (2.25 KB, patch)
2010-11-19 17:30 UTC, Dan Winship
committed Details | Review

Description Dan Winship 2010-11-19 16:13:06 UTC
If the drag actor is destroyed (possibly as part of a drag target
accepting it), we were not calling ungrabEvents, meaning the
mouse/keyboard remained grabbed until you clicked somewhere to cancel
it.

This fixes that without trying to improve the extremely confusing
control flow...
Comment 1 Dan Winship 2010-11-19 16:13:07 UTC
Created attachment 174855 [details] [review]
dnd: call ungrabEvents when the drag actor is destroyed
Comment 2 Owen Taylor 2010-11-19 16:23:03 UTC
Review of attachment 174855 [details] [review]:

Wow, that code flow is confusing - "that patch can't be right, the drag isn't getting cancelled... oh wait"

Looks fine to me, I'd make the commit message "dnd: call ungrabEvents _even_ when the drag actor is destroyed"
Comment 3 Florian Müllner 2010-11-19 16:33:41 UTC
(In reply to comment #1)
> Created an attachment (id=174855) [details] [review]
> dnd: call ungrabEvents when the drag actor is destroyed

Hmm, when an actor is destroyed during a drag operation, the mouse button is still pressed. So releasing the grab at that point means that the actor which happens to be underneath the pointer when the button is released processes the event, right?
Comment 4 Dan Winship 2010-11-19 17:30:57 UTC
Created attachment 174864 [details] [review]
dnd: fix a case where ungrabEvents wasn't being called

take 2. This only calls ungrabEvents from _cancelDrag if (a) the actor
was destroyed, and (b) the mouse button is not pressed, which should
limit it to just this case
Comment 5 Owen Taylor 2010-11-19 20:08:18 UTC
Review of attachment 174864 [details] [review]:

sure. (generally I think things only need to be reactive to press/release not isolated release. (See the bug I just filed about clicking off menus.)
Comment 6 Dan Winship 2010-11-19 20:11:06 UTC
Attachment 174864 [details] pushed as b7c1400 - dnd: fix a case where ungrabEvents wasn't being called