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 661151 - window-clone: Require a button-press before activating
window-clone: Require a button-press before activating
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: 2011-10-07 05:52 UTC by Florian Müllner
Modified: 2011-10-11 11:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
window-clone: Require a button-press before activating (2.30 KB, patch)
2011-10-07 05:52 UTC, Florian Müllner
accepted-commit_now Details | Review
window-clone: Use ClutterClickAction (3.05 KB, patch)
2011-10-07 14:15 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2011-10-07 05:52:19 UTC
See attached patch. This has annoyed me for quite some time :-)
Comment 1 Florian Müllner 2011-10-07 05:52:21 UTC
Created attachment 198504 [details] [review]
window-clone: Require a button-press before activating

Right-click menus in the dash can be dismissed by clicking anywhere
outside the menu. However, if a window clone is located beneath the
pointer when doing so, the window is activated and the overview
closed.
The cause of this unexpected behavior is that window previews are
activated on button-release, which is delivered to the preview after
the menu releases its grab on button-press. To fix, require that
window previews receive a button-press event before activating.
Comment 2 Jasper St. Pierre (not reading bugmail) 2011-10-07 05:55:53 UTC
Seems like making menus go away on button-release might be better?

Yeah, yeah, it's inconsistent with GtkMenu... maybe hide the menu on press, undo the grab on release?
Comment 3 Florian Müllner 2011-10-07 07:22:48 UTC
(In reply to comment #2)
> Seems like making menus go away on button-release might be better?

I don't agree - it doesn't make sense to me either that clicking on the panel and releasing on a window preview activates the window (I know that example is completely artificial, but I still think that requiring a "click" (== press+release) makes sense here). Maybe I should update the patch to require the same button though ...


> Yeah, yeah, it's inconsistent with GtkMenu...

No, it is *currently* inconsistent with GtkMenu ...
Comment 4 drago01 2011-10-07 10:16:09 UTC
Review of attachment 198504 [details] [review]:

Yeah this have annoyed me for a while as well, and the fix makes sense to me.
Comment 5 Florian Müllner 2011-10-07 10:30:19 UTC
(In reply to comment #4)
> Review of attachment 198504 [details] [review]:
> 
> Yeah this have annoyed me for a while as well, and the fix makes sense to me.

Would it make sense though to change the boolean _pressed to an integer _pressedButton?
Comment 6 Dan Winship 2011-10-07 12:11:41 UTC
Comment on attachment 198504 [details] [review]
window-clone: Require a button-press before activating

ClutterClickAction is supposed to solve this problem. We should use that everywhere rather than doing halfway measures. (Note that since your patch doesn't get a pointer grab, you can press the button on a clone, move outside the clone, release the button, press again, move back into the clone, and release, and it will be activated.)
Comment 7 Florian Müllner 2011-10-07 12:30:59 UTC
(In reply to comment #6)
> (Note that since your patch
> doesn't get a pointer grab, you can press the button on a clone, move outside
> the clone, release the button, press again, move back into the clone, and
> release, and it will be activated.)

No, because press+move starts a dragging action.
Comment 8 Florian Müllner 2011-10-07 14:15:57 UTC
Created attachment 198537 [details] [review]
window-clone: Use ClutterClickAction

Right-click menus in the dash can be dismissed by clicking anywhere
outside the menu. However, if a window clone is located beneath the
pointer when doing so, the window is activated and the overview
closed.
The cause of this unexpected behavior is that window previews are
activated on button-release, which is delivered to the preview after
the menu releases its grab on button-press. Use a ClutterClickAction
instead and let Clutter do the right thing, i.e. only trigger a
'clicked' signal when a button-release event is matched by a
corresponding button-press event.
Comment 9 drago01 2011-10-11 09:08:17 UTC
Review of attachment 198537 [details] [review]:

Looks good.
Thinking about it we should probably replace our custom event handling with clutter actions where appropriate (unrelated to this patch though).
Comment 10 Florian Müllner 2011-10-11 11:00:08 UTC
Attachment 198537 [details] pushed as 7bc2573 - window-clone: Use ClutterClickAction

(In reply to comment #9)
> Thinking about it we should probably replace our custom event handling with
> clutter actions where appropriate (unrelated to this patch though).

Agreed.