Repository navigation
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
Confirmed to impact these versions:
v16, v17.0.0, v20.1.0, v30.5.1, v31.6.0, v32.1.2
Probably impacts all versions in between.
What operating system are you using?
- Linux (NixOS, Ubuntu) - testcase gist results in handling of app commands on both button down and button up
- Window - testcase gist works as expected moving back/forward once per press
Operating System Version
Linux lun-hisame-nixos 5.15.19-xanmod1-tt #1-NixOS SMP PREEMPT Tue Jan 1 00:00:00 UTC 1980 x86_64 GNU/Linux
Linux lun-hisame-nixos 6.11.0 #1-NixOS SMP PREEMPT_DYNAMIC Sun Sep 15 14:57:56 UTC 2024 x86_64 GNU/Linux
Multiple distros and downstream apps relying on Electron reported in the comments.
What arch are you using?
x64, aarch64
Last Known Working Electron version
4
Expected Behavior
When pressing back/forward mouse buttons on linux, either app command events should be created OR they should be automatically handled and cause navigation.
Two suggested approaches:
- To match Windows behaviour, we should emit app-command events and not cause navigation.
- To minimise breakage of existing Linux apps that don't handle app-command, app-command events should not be emitted and the navigation should still be done automatically
Actual Behavior
When the mouse side buttons are used, app command events are created AND navigation is automatically done so if an app handles the app-command events per the documentation then navigation will happen twice.
#15441 added support for app-command handlers: browser-backward and browser-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.
Testcase Gist URL
Additional Information
A previous ticket was closed #18322 but this is still a problem. I have asked for it to be reopened, but noone seems to have seen that.
Related third party ticket https://support.discord.com/hc/en-us/community/posts/1500000622702-Thumb-mouse-button-on-Linux-registers-twice
Activity
mlaurencin commentedon Feb 8, 2022
Thanks for reporting this and helping to make Electron better!
Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use. If you take the code from either of the examples you provided and the issue replicable in the Fiddle Gist, that will helpful.
Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.
I'm adding the
blocked/need-reprolabel for this reason. After you make a test case, please link to it in a follow-up comment.LunNova commentedon Feb 8, 2022
@mlaurencin
index.js
On Windows: back/forward button presses will go back/forward one page at a time
On Linux: back/forward button presses will go back/forward two pages instead (once when button is pressed and once when released)
LunNova commentedon Feb 8, 2022
https://gist.github.com/LunNova/a4c61b7082d17b8aa637217f763348bf
hjkatz commentedon May 16, 2022
I'm experiencing this issue with Slack's snap on Ubuntu 22.04 as well.
lmcarreiro commentedon Jun 17, 2022
Same here, very annoying bug!
If I install Slack from another source instead of snap, would we have the same issue?
hjkatz commentedon Jun 17, 2022
No, I've tried both versions and it seems to be a problem with Slack's imported version of Electron. I also reached out to Slack support and they said they were aware of the problem, but gave no timeline for an intended fix.
diniamo commentedon Jul 26, 2022
I have this issue on Discord as well.
edoardopirovano commentedon Aug 9, 2022
Also experiencing this on Slack in Ubuntu 22.04.
rneatherway commentedon Aug 17, 2022
Same here. Is there any way that we could move the discussion forward on which solution might be workable?
@MarshallOfSound might you have an opinion? I ask as you reviewed #15441 and your profile indicates that you work at Slack right now.
55 remaining items
Tejeev commentedon Feb 4, 2025
@mlaurencin is there any hope here?
Tejeev commentedon Feb 4, 2025
Looks like folks were updating their app.sar but I don't see one of those in the snap, or I don't know how snaps really work and kinda hate them... probably the later
shinebayar-g commentedon Feb 4, 2025
Flatpak or Snap doesn't seem to provide .asar files, so I use native package managers and edit the slack file manually for now.
Tejeev commentedon Feb 4, 2025
oh, like install from a .deb or something and then edit the file? Snap is unfortuantely native in Ubuntu these days. I keep telling myself I'm going to change distros, but haven't had the time to migrate my configurations and etc to a new distro, let alone pick one.
Tejeev commentedon Feb 5, 2025
Ok, so now I need to know how to handle this in the apps whcih do not have a .deb. I've got one or two electron app based tools I use for work which are only published as snaps.
We need a fix from Electron as this is not a third party problem. This is an electron bug
frends-dani commentedon Feb 19, 2025
bump
TomerGodinger commentedon Mar 23, 2025
My god, I restarted my computer today, two years after last writing here, and this has finally stopped happening in Slack for me.
(Ubuntu 22.04.5, Slack version 4.43.43 64-bit.)
I don't know what caused the change, but I'm just really happy to finally stop having this issue! 😁
umpirsky commentedon Mar 23, 2025
I can confirm it finally stopped for me on
Ubuntu 24.04.2 LTStoo!AleksandrKls commentedon Mar 23, 2025
Wow, I can confirm too
Ubuntu 24.04.2 LTS"Let the ticket breathe" and the problem solved itself
eliliam commentedon Mar 23, 2025
Same! What was the thing that actually fixed this issue?
amcsi commentedon Apr 15, 2025
Looks like it's fixed for me also on
Ubuntu 24.04.2 LTS. Not sure if it was the distro or some newer Electron version.lythandas commentedon Apr 15, 2025
Working on
Ubuntu 24.04.2 LTSconfirmed! Great news!mlaurencin commentedon Apr 15, 2025
Thank you to everyone that has confirmed this issue is resolved for them using
Ubuntu 24.04.2 LTS. Given the number of confirmations, I'm going to go ahead and close this issue. If you are still experiencing it, rather than comment here, please file a new bug report with all the relevant information.umpirsky commentedon Apr 15, 2025
Anyone knows what fixed it?