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 693887 - Add Long Press behaviour to Context Menu
Add Long Press behaviour to Context Menu
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: message-tray
unspecified
Other Linux
: Normal minor
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-02-15 14:13 UTC by Joern
Modified: 2013-02-16 18:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
messageTray: Allow opening the context menu on long press (4.24 KB, patch)
2013-02-15 15:22 UTC, drago01
none Details | Review
messageTray: Allow opening the context menu on long press (4.38 KB, patch)
2013-02-15 15:24 UTC, drago01
none Details | Review
messageTray: Allow opening the context menu on long press (3.15 KB, patch)
2013-02-15 21:56 UTC, drago01
reviewed Details | Review
messageTray: Allow opening the context menu on long press (3.15 KB, patch)
2013-02-16 18:34 UTC, drago01
committed Details | Review

Description Joern 2013-02-15 14:13:42 UTC
Like suggested in bug 691035 the Context Menu should support some form of Long Press behavior for Form Factors that either work with Touchscreens or simply don't have a Mouse Button 3 a.k.a. right-click (for whichever reason).
Comment 1 drago01 2013-02-15 15:22:42 UTC
Created attachment 236255 [details] [review]
messageTray: Allow opening the context menu on long press

Right click does not work for touch devices, so support opening the menu
using long press as well.
Comment 2 drago01 2013-02-15 15:24:29 UTC
Created attachment 236256 [details] [review]
messageTray: Allow opening the context menu on long press

Right click does not work for touch devices, so support opening the menu
using long press as well.
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-02-15 20:23:03 UTC
Why not use a ClutterClickAction like the rest of the code?
Comment 4 drago01 2013-02-15 21:37:26 UTC
(In reply to comment #3)
> Why not use a ClutterClickAction like the rest of the code?

1) We don't (the AppWellIcon does not)
2) Because it seems to be broken 'long-press' gets triggered for every click which makes it kind of useless.
Comment 5 drago01 2013-02-15 21:56:32 UTC
Created attachment 236311 [details] [review]
messageTray: Allow opening the context menu on long press

Right click does not work for touch devices, so support opening the menu
using long press as well.


---

OK it isn't broken I was using it wrong.
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-02-15 22:05:29 UTC
Review of attachment 236311 [details] [review]:

::: js/ui/messageTray.js
@@ +1743,2 @@
         this._contextMenu = new MessageTrayContextMenu(this);
         this._grabHelper.addActor(this._contextMenu.actor);

Now that I look at it, this line seems wrong. addActor is for additional actors that need to be responsive during any grab (hot corner, for example), not for the grab actors themselves.

@@ +1752,3 @@
+                this._openContextMenu();
+             else if (button == 1 && this._contextMenu.isOpen)
+                this._contextMenu.close();

When this happens, it's a click outside of the context menu, meaning that the grab helper should notice and call onUngrab. Is that not the case?
Comment 7 drago01 2013-02-15 22:11:48 UTC
(In reply to comment #6)
> Review of attachment 236311 [details] [review]:
> 
> ::: js/ui/messageTray.js
> @@ +1743,2 @@
>          this._contextMenu = new MessageTrayContextMenu(this);
>          this._grabHelper.addActor(this._contextMenu.actor);
> 
> Now that I look at it, this line seems wrong. addActor is for additional actors
> that need to be responsive during any grab (hot corner, for example), not for
> the grab actors themselves.

Removing it results into the tray getting ungrabbed as soon as the menu opens. Ungrabbing the tray causes it to close. So you end up with the menu outside of the tray.

> @@ +1752,3 @@
> +                this._openContextMenu();
> +             else if (button == 1 && this._contextMenu.isOpen)
> +                this._contextMenu.close();
> 
> When this happens, it's a click outside of the context menu, meaning that the
> grab helper should notice and call onUngrab. Is that not the case?

No. Only when you click outside of the message tray.
Comment 8 drago01 2013-02-16 18:34:56 UTC
Created attachment 236394 [details] [review]
messageTray: Allow opening the context menu on long press

Right click does not work for touch devices, so support opening the menu
using long press as well.


OK, those hacks are no longer needed with the fixes from bug 693975
Comment 9 Jasper St. Pierre (not reading bugmail) 2013-02-16 18:36:07 UTC
Review of attachment 236394 [details] [review]:

Tested, seems to work well.
Comment 10 drago01 2013-02-16 18:37:46 UTC
Attachment 236394 [details] pushed as 186bd15 - messageTray: Allow opening the context menu on long press