Skip to content
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

Right mouse context menu not working #12

Open
orschiro opened this issue Apr 14, 2018 · 5 comments
Open

Right mouse context menu not working #12

orschiro opened this issue Apr 14, 2018 · 5 comments

Comments

@orschiro
Copy link

Hey @rotemdan thanks so much for your extension!

Tried it on Fedora 28 with GNOME 3.28 and Chrome 65.

However, my right mouse context menu is no longer functional.

It's not opening. Any ideas?

Thanks!

@rotemdan
Copy link
Owner

rotemdan commented Apr 14, 2018

Hi, thanks for trying the extension. The Chrome version only supports Windows at the moment (Firefox version does support Linux, but it's still experimental). I believe that should be mentioned in the extension description on the Chrome Web Store.

The reason for the lack of support on Chrome is because of the difference in contextmenu event and mouseup event ordering between Windows and Linux/macOS. In Windows the contextmenu event is triggered after mouseup, and in Linux/maxOS it is in the opposite order.

Unfortunately having the mouseup event triggered after contextmenu makes it difficult to detect gestures reliably. In Firefox (since version 58 I believe) there is a special about:config setting that reverses this ordering in Linux/macOS as well (and is automatically enabled by the extension). I haven't yet investigated how to achieve something similar in Chrome. The extension was originally designed for Firefox mainly (though I've made most of my testing on Chrome).

This is tracked by issue #5.

@orschiro
Copy link
Author

Thanks for your insightful reply! Maybe worthwhile to file a bug on the Chromium bug tracker and ask for some help there?

@rotemdan
Copy link
Owner

I believe this chromium issue is related (and is marked as wontfix):
https://bugs.chromium.org/p/chromium/issues/detail?id=751142

As an alternative approach I'm considering detecting the gesture on mousemove instead of mouseup and then finalize it in either contextmenu or mouseup event (whichever comes first).

At this time, though, I can't tell what kind of subtle issues might arise using this method. I need to look at it further.

@orschiro
Copy link
Author

Thanks for looking into this! Would it maybe work if we map it to middle mouse button?

@rotemdan
Copy link
Owner

I've experimented with trying to detect the gesture earlier but unfortunately it seems like it is not possible to do so.

On Linux/macOS the contextmenu event seems to fire immediately after mousedown (and before any mousemove event is triggered). There is no way to guess, at that point, if a gesture is intended by the user.

I personally don't think that assigning the middle mouse button would be a usable alternative. I feel that this is too much of a compromise (that's taken for pure technical reasons), and would be inconsistent between the platforms (this is only my personal view though).

I will try to think of other workarounds but currently I don't have any. I'll also try to look up at how other mouse gesture extensions are dealing with issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants