-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppressing context menu in OSX #4
Comments
Perhaps you should watch on click event, and use event.button to determine which mouse button was used. |
The gesture button is already configurable. The problem is that in OSX - at the time when contextmenu event is fired - I don't know if the user will do a gesture or not. So, I cannot event.preventDefault() or I may break the context menu for the user. |
@marklieberman Instead of contextmenu, can't you simply rely on the mousedown or click event? Then you can check if it was using right click using event.button. |
If the user does: If the user does: In Windows the events are in this order: In OSX the events are in this order: As you can see, I need contextmenu to be after mousemove in order to know if the user started a gesture or not because I have to decide when to call event.preventDefault() in contextmenu. |
On my side, no events are triggered at all when doing two finger (=context menu) gesture, which might be the issue. |
That's very strange, because it works fine on my Macbook on FF53 aside from the context menu getting in the way. You just have to go left or up to avoid the context menu. What about if you change the gesture button to Left? |
Left just works fine, but I'm guessing this issue is about the one I reported while reviewing your addon. |
Closing for #10. See also: https://bugzilla.mozilla.org/show_bug.cgi?id=1360278 |
Same problem is on Linux system too - when I do a right click - menu is shown and breaks Gesture functionality :( As workaround we can stay FireGestures plugin active (with disabled gesture) that disable instant menu showing, and use it together with new Foxy Gestures :) |
I was just trying to figure out a way to capture a Some gesture extensions inhibit the context menu, but require a double click to open it. That might be worth looking into. I know SmartUp gestures (not open source) does this. It's a significant impediment to anyone's workflow, until they eventually get used to it. |
@kafene Unfortunately, there is no way to programmatically open the content menu. The best solution is to submit a patch to implement https://bugzilla.mozilla.org/show_bug.cgi?id=1360278 but I don't have any experience building Firefox. I do want to spend time learning how to do it, I just don't have free time at the moment. The potential workarounds I was going to implement are: 1) smartUp style double-right click, 2) use a modifier key to disable gestures, 3) use a modifier key to perform a gesture. |
Same here. I will look into it. I bet it would be a great thing to have on my resume but this is kind of a hard-mode bug for me because I'll have to learn how to build and test Firefox. Not sure if that's going to happen. I do know a lot about XPCOM/XUL and the Firefox "inner platform" from writing old extensions; maybe it can be implemented as a WebExtension experiment, although I think those are mainly for implementing new WebExtension features, and Andy McKay has declared that a WebExtension API to open the context menu has no use case. For now, I will start exploring and see if I can even find the code that would handle this. Brainstorming here - if I do implement this as a pref, I'm thinking it would be like this:
If there's any Firefox bug I want to tackle, it's this one, since mouse gestures are a non-negotiable part of my workflow. I blame Jon von Tetzchner. In the meantime - I think the double-click trigger is the best option to prioritize. To be honest one main reason I use mouse gestures a lot is because I'm reclined in my chair and lazy to reach to the keyboard to use keyboard shortcuts. Also thank you for your hard work on this extension. Edit: for anyone reading this, a patch has been submitted to Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1360278#c9 |
@kafene Thanks for looking into this. If you manage to implement this pref that would be amazing. BTW, I'm the reporter on the bugzilla bug. |
In crxMouse Gestures on Chrome what they did is an option to show context menu on double rmb click and use single rmb for gestures. |
This night there was an update for Firefox on Ubuntu. Firefox itself still says only "57.0" in the help box, but (well, it's also gone 90% of the time, but at least FoxyGestures is pretty well like was FireGestures for me!) |
The context menu is not suppressed in OSX because the context menu event fires on mouse down.
On Windows, it fires on mouse up. This affords me the ability to suppress the contextmenu event if a gesture has started.
This is a problem on OSX because at the time when contextmenu event is fired I do not know if a gestures has started. If I choose to preventDefault() the context menu, I cannot trigger the contextmenu event again using pure JavaScript or WE APIs.
The only workaround I can think of is a modifier key to either enable or disable gestures, and then only suppress the context menu when the modifier key is pressed.
The text was updated successfully, but these errors were encountered: