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

globalShortcut not very global in Wayland #15863

Closed
Pajn opened this issue Nov 28, 2018 · 5 comments
Closed

globalShortcut not very global in Wayland #15863

Pajn opened this issue Nov 28, 2018 · 5 comments

Comments

@Pajn
Copy link

Pajn commented Nov 28, 2018

  • Output of node_modules/.bin/electron --version: v3.0.10
  • Operating System (Platform and Version): Ubuntu 18.10, Wayland
  • Output of node_modules/.bin/electron --version on last known working Electron version (if applicable): N/A

Expected Behavior
After registering a global shortcut it should always be called when that combinations is pressed.
If the DE holds that shortcut it may be captured by the DE though. But a free combination should continue to work when new applications are opened though.

Actual behavior
Some applications, for example gnome-terminal capture the shortcut so that it is registered by the application instead of my global handler.

To Reproduce
Use gnome wayland session, Register a global shortcut and make sure it works, Open gnome-terminal and see that it does not work.

Screenshots
N/A

Additional Information
N/A

@welcome
Copy link

welcome bot commented Nov 28, 2018

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@codebytere
Copy link
Member

Given that this has been open for years, that this isn't currently on our roadmap, and in the interest of our issue tracker more closely reflecting our workstreams, i'm going to go ahead and label this a wontfix. However, should someone determine a workable solution we would be potentially open to accepting a PR!

@vbarbarosh
Copy link

I confirm, this happens to me on Ubuntu 20.04 with Electron 20.1.3. Each time I switch to a Gnome Terminal, globalShortcut's are not working. This makes them not so global.

@vbarbarosh
Copy link

vbarbarosh commented Sep 10, 2022

In order to reproduce just open gnome-terminal and

mkdir a
cd a
echo {} > package.json
cat > app.js << 'EOF'
require('electron').app.whenReady().then(function () {
    const ret = electron.globalShortcut.register('Meta+I', function () {
        console.log('globalShortcut triggers!');
    });
});
EOF
npm install electron
node_modules/.bin/electron app.js

@Tbhesswebber
Copy link

Just want to call out that I stumbled across this Reddit post while attempting to debug Eugeny/tabby#8957. It sounds like Wayland potentially requires manually forwarding the keypress to Electron.

Is there a way to manually fire a keyboard event from the command line?

cc: @codebytere

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

4 participants