FS#61047 - [atom] Middle click doesn't close tab
Attached to Project:
Community Packages
Opened by Alexander Popov (AlexWayfer) - Wednesday, 12 December 2018, 17:26 GMT
Last edited by Nicola Squartini (tensor5) - Wednesday, 02 January 2019, 12:09 GMT
Opened by Alexander Popov (AlexWayfer) - Wednesday, 12 December 2018, 17:26 GMT
Last edited by Nicola Squartini (tensor5) - Wednesday, 02 January 2019, 12:09 GMT
|
Details
Steps to reproduce:
1. Click on tab via middle mouse button (wheel) Expected behavior: Tab is closing. Actual behavior: Tab isn't closing. Reproduces how often: 100% Additional info: * package version: `1.32.2-2` * config: even reset and in safe mode. Reference: https://github.com/atom/tabs/issues/545 |
This task depends upon
Closed by Nicola Squartini (tensor5)
Wednesday, 02 January 2019, 12:09 GMT
Reason for closing: Fixed
Additional comments about closing: 1.33.1-2
Wednesday, 02 January 2019, 12:09 GMT
Reason for closing: Fixed
Additional comments about closing: 1.33.1-2
Electron 3 uses a newer chromium version, and chromium since version 55 seems to implement a new behaviour, where click of non-primary (such as the middle) mouse buttons do not fire the "click" event anymore, but "auxclick".
https://stackoverflow.com/questions/44578022/electron-prevent-middle-click
https://developer.mozilla.org/en-US/docs/Web/Events/auxclick
A simple fix is to add the onClick handler in the tab package not only to "click" but also to "auxclick".
A patch for the tabs package and a diff of the PKGBUILD are attached
PKGBUILD.diff (1.3 KiB)
But I see Electron version 2 in the `package.json` file of Atom: https://github.com/atom/atom/blob/48618e5/package.json#L15
Does it mean that `atom` package should be locked at Electron version 2? And it doesn't use Electron 3.
Yes, because that is, what Atom is officially bundled with, and the only version officially supported by the Atom maintainers themselves.
The Archlinux PKGBUILD applies some patches, so that actually Electron 3 is used.
> Does it mean that `atom` package should be locked at Electron version 2?
Well yes, changing the dependency from electron to electron2 in the PKGBUILD (and removing the associated patches to fix other problems with Electron 3) would be the other solution to our problem. But i have not tested that.
For me, it would be the best solution, if they would incorporate the fix in upstream, since the added line does nothing in Electron 2 but fixes the behaviour in Electron 3. But given that using any other version of Electron than the one that it is officially bundled with, i doubt that they would accept a pull request. The referenced issue on github was already closed on that grounds.
They should be willing to accept a PR with clearly explained rationale, that works on the current official atom release and also makes it easier for whatever future time they end up migrating to electron 3.x
As usual in the open-source world, the best way to *guarantee* that things are fixed is to take advantage of the open-source nature and implement the fix yourself. :) This goes 50x for atom... it is also what our atom maintainer usually does in this situation.
We will see if they merge it.
Edit 24.2.2019: The merge request in upstream has just been merged, so with the next release of atom, our patch here should not be necessary anymore.