GNOME Bugzilla – Bug 693887
Add Long Press behaviour to Context Menu
Last modified: 2013-02-16 18:37:50 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).
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.
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.
Why not use a ClutterClickAction like the rest of the code?
(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.
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.
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?
(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.
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
Review of attachment 236394 [details] [review]: Tested, seems to work well.
Attachment 236394 [details] pushed as 186bd15 - messageTray: Allow opening the context menu on long press