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

Fix tab close on middle click for Electron 3 #552

Merged
merged 1 commit into from Jan 24, 2019

Conversation

Projects
None yet
3 participants
@VarNepvius
Copy link
Contributor

VarNepvius commented Dec 21, 2018

Description of the Problem

When using Atom with Electron 3, a middle click does not close a tab. This happens, because Electron 3 is based on a Chrome version >= 55. Since then, Chrome changed how click events work. Non-primary clicks now fire the event auxclick rather than click.

See https://developers.google.com/web/updates/2016/10/auxclick and https://developer.mozilla.org/en-US/docs/Web/Events/auxclick for more information on the event.

Description of the Change

This PR adds the onClick handler of TabBarView also as listener to the auxclick event.

Alternate Designs

None

Benefits

The change fixes the problem for Electron 3 while it does have no effect in Electron 2, since the auxclick event never fires in this version.

This helps with a future migration of Atom to Electron 3 and fixes the issue for unofficial distributions using Electron 3 now.

Possible Drawbacks

None

Applicable Issues

fixes #545

@eli-schwartz

This comment has been minimized.

Copy link

eli-schwartz commented Dec 23, 2018

One unofficial distribution using electron 3 today is Arch Linux: https://bugs.archlinux.org/task/61047

@eli-schwartz eli-schwartz referenced this pull request Dec 23, 2018

Merged

Upgrade to Electron 3.0 #18603

59 of 59 tasks complete
@daviwil

This comment has been minimized.

Copy link
Member

daviwil commented Jan 24, 2019

Thanks a lot, @VarNepvius! Verified that this fixes the issue on a build of Atom on Electron 3 and it also doesn't have any negative side effects on Atom 1.34.0 stable.

@daviwil daviwil merged commit 949a38d into atom:master Jan 24, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.