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

After update, every pressing 'alt' key opens the top menu #4345

Closed
ara4n opened this issue Jun 18, 2017 · 24 comments
Closed

After update, every pressing 'alt' key opens the top menu #4345

ara4n opened this issue Jun 18, 2017 · 24 comments

Comments

@ara4n
Copy link
Member

ara4n commented Jun 18, 2017

this is ANNOYING BUG, for example, alt+shift combination is the most popular for change keyboard layout, alt+tab for task switching.

Says user on rageshake 198 on Riot Desktop 0.10.1 on Linux

@strixaluco
Copy link
Contributor

Can't replicate on Riot Desktop 0.11.3 @ Debian Stretch

@uhoreg
Copy link
Member

uhoreg commented Jun 22, 2017

can't replicate here either

@t3chguy
Copy link
Member

t3chguy commented Jun 23, 2017

nor here

@MRZA-MRZA
Copy link

I experience this HIGHLY annoying bug on Riot 0.11.4 on Ubuntu 17.04.

@t3chguy
Copy link
Member

t3chguy commented Jul 5, 2017

Can you provide more than your Base distribution as information. The more the better considering we cannot reproduce it, I tried on kde neon 17.04

@MRZA-MRZA
Copy link

I'm using XFCE4. What kind of information do you need?

@strixaluco
Copy link
Contributor

Still not reproducible on Riot Desktop 0.11.4 on Debian Buster with GNOME Shell 3.22.3.
@MRZA-MRZA, you mean exactly Alt+Shift sequence, not the opposite (Shift+Alt)? The latter does trigger the top menu indeed.

@MRZA-MRZA
Copy link

Yes, I use Alt+Shift to switch keyboard layout.

@uhoreg
Copy link
Member

uhoreg commented Jul 6, 2017

What method are you using to make Alt+Shift switch the keyboard?

My guess is that something eats the Shift key, so Electron only sees "Alt down, Alt up", instead of "Alt down, Shift down, Alt up", and so the menu gets triggered.

@MRZA-MRZA
Copy link

What method are you using to make Alt+Shift switch the keyboard?

What do you mean? It's default for xfce4 I guess.

@uhoreg
Copy link
Member

uhoreg commented Jul 6, 2017

OK, setting "Alt-Shift" as the "Change layout option" in xfce4-keyboard-settings, I can reproduce it. If I hold down "Alt", and then hit "Shift", the menu bar immediately appears. Interestingly, this does not happen in Firefox, which also toggles the menu bar when "Alt" is pressed.

@MurzNN
Copy link
Contributor

MurzNN commented Jul 11, 2017

Same problem on Ubuntu Linux and KDE with Riot-web Desktop app: Alt+Shift changes keyboard layout, but in Riot it also activate menu, so users must manually return focus to message area for continue typing.
If I press Shift+Alt - all works well, but this is too uncomfortable.

@MurzNN
Copy link
Contributor

MurzNN commented Jul 12, 2017

@ara4n from which version does this issue active? If I downgrade version - Alt will works normally?

@ara4n
Copy link
Member Author

ara4n commented Jul 17, 2017

@t3chguy do you happen to know how to stop electron from intercepting alt like this?

@t3chguy
Copy link
Member

t3chguy commented Jul 17, 2017

only thing I can think of is to capture it ourselves, and preventDefault if it is pressed with shift, can't do it without my hands on a system that does this though, I'll try it in a VM again

@uhoreg
Copy link
Member

uhoreg commented Jul 17, 2017

FTR, it's not just Alt-Shift. It also happens if you have XFCE4 set to use other combinations for switching keyboards, such as Alt-Ctrl, Alt-CapsLock, and Alt-Space.

@MurzNN
Copy link
Contributor

MurzNN commented Jul 18, 2017

Confirm that this problem exists with Alt-Ctrl, Alt-CapsLock, and Alt-Space on KDE4 too. But if I change hotkey form Alt+Shift to Alt+Ctrl - Alt+Shift combination goes to work normally (without activating menu).

But when I press Shift+Alt (shift is first) - all works normally.

So bug happens only when we press combination for change keyboard language/layout. Seems the problem is with changing focus to some language switch process with Alt stay pressed in our app.

@MurzNN
Copy link
Contributor

MurzNN commented Jul 18, 2017

@MurzNN
Copy link
Contributor

MurzNN commented Jul 18, 2017

And seems here is solution: https://github.com/saenzramiro/rambox/issues/120#issuecomment-244884398
I try to fix them, find same code in /opt/Riot/resources/electron.asar file, but seems it is binary, because if I change something - I got startup error:

/opt/Riot/resources/electron.asar/browser/init.js:174
Module._load(path.join(packagePath, main
                                    ^^^^
SyntaxError: missing ) after argument list
    at Object.exports.runInThisContext (vm.js:78:16)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:424:7)
    at startup (bootstrap_node.js:147:9)
    at bootstrap_node.js:544:3

MurzNN added a commit to MurzNN/riot-web that referenced this issue Jul 18, 2017
Fix activating menu when changing keyboard language / layout  via Alt-Shift, Alt-Ctrl, Alt-CapsLock, and Alt-Space
@MurzNN
Copy link
Contributor

MurzNN commented Jul 18, 2017

I have found another file and those changes fix this issue, so I provide pull request: #4623

@nekomiko
Copy link

nekomiko commented Jul 27, 2017

Patch fixes issue only partly. Menu no longer opens, but toggles its visibility if I:

  1. press alt
  2. press shift
  3. unpress alt
  4. upress shift
    but not if I upress keys in different order.

Update: It is related to my Xorg update to 1.19.3 and the fact that the patch against 865 is no longer included with newer Xorg, so hotkeys are broken in a few ways.

(updated by Michael to emphasise the update)

@YevgenK
Copy link

YevgenK commented Aug 16, 2017

Same issue when I press alt+shift.

Kubuntu 16.04, plasmashell 5.8

@t3chguy
Copy link
Member

t3chguy commented Aug 16, 2017

Weird, I could not reproduce on my KDE Neon installation

@MurzNN
Copy link
Contributor

MurzNN commented Aug 24, 2017

@nekomiko - can't reproduce this on KDE, seems this is your local issue. Now menu opens only when I press Alt and unpress it without other keys, so no problems. I'll try to finish pull request.

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

No branches or pull requests

10 participants