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
Linux: Double actions when handling app-command
handlers: browser-backward
and browser-forward
#18322
Comments
Just confirmed that |
Thank you for taking the time to report this issue and helping to make Electron better. The version of Electron you reported this on has been superseded by newer releases. If you're still experiencing this issue in Electron 6.x.y or later, please add a comment specifying the version you're testing with and any other new information that a maintainer trying to reproduce the issue should know. I'm setting the Thanks in advance! Your help is appreciated. |
Thank you for your issue! We haven't gotten a response to our questions in our comment above. With only the information that is currently in the issue, we don't have enough information to take action. I'm going to close this but don't hesitate to reach out if you have or find the answers we need, we'll be happy to reopen the issue. |
I have now tested this on electron 8.0.2 on Linux, and the back/forward mouse buttons are still functioning without binding app-command. The documentation still suggests that binding this event is needed:
This is by no means a major issue, but just misleading: if the docs are followed, double actions will be registered. |
I worked around this for now by using Piper to reassign the forward/back buttons on my Logitech mouse to "alt+left" and "alt+right" rather than "backward/forward". This has a side-effect of focusing the menubar in electron apps, which is annoying and clunky, but less so than double actions. |
This should be reopened as it is still an issue. Discord issue caused by this issue: https://support.discord.com/hc/en-us/community/posts/1500000622702-Thumb-mouse-button-on-Linux-registers-twice |
@LunNova how can i apply your "workaround" with BetterDiscord? |
Apply the same .diff but to this file and change |
I've ended up with this browserwindow.js |
Maybe that should be
Otherwise, not sure and I don't use BetterDiscord, sorry. |
Here's a NavigationFix for BD. |
@Inve1951 Thanks brother. |
Raised #32763 since it seems unlikely this will get reopened. |
@hawkeyetwolf, this workaround with Piper, is it possible to use it with Slack/Discord only, and keep default behavior on other apps? Could you share more details about it or how to do it? Thanks. |
@lmcarreiro, Piper is a system-wide tool, so I don't think there's a way to limit it to Slack/Discord only, unfortunately. And it only works for the mouse buttons, but in my case, that's all I needed. Here's a post about configuring Piper. |
Preflight Checklist
Issue Details
#15441 added support for
app-command
handlers:browser-backward
andbrowser-forward
on Linux.The docs describe how to make use of these here:
https://github.com/electron/electron/blob/v5.0.1/docs/api/browser-window.md#event-app-command-windows-linux
Our code is very similar here, and has been in place to support windows for years:
https://github.com/irccloud/irccloud-desktop/blob/master/app/main.js#L293-L311
When testing this on Ubuntu 19.04, this results in back and forward actions being triggered twice when using the appropriate mouse buttons.
I wonder if it's necessary to have these handlers on Linux or if they should only be registered on Windows?
My hunch is that the action is already automatically handled, and the handlers just repeat it. If this is the case, the docs should be updated.
An
e.preventDefault()
might also fix the issue but that seems like the wrong fix.The text was updated successfully, but these errors were encountered: