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

Cannot toggle windows on Mac using "non-standard" keyboard layouts (eg British - PC; French) #17287

Closed
alecgibson opened this issue Mar 8, 2019 · 9 comments

Comments

@alecgibson
Copy link

Expected Behavior

Normally on MacOS, you can toggle between two windows of the same app with ⌘ + ` (Cmd + backtick). I have verified that this works in other apps installed on my machine (eg Chrome).

I expect to be able to do the same with Electron windows.

Actual Behavior

Using Cmd + Backtick toggles windows using the "British" keyboard layout, but not the "British - PC" layout.

To Reproduce

  1. Use macOS
  2. Clone this repo: https://github.com/alecgibson/electron-quick-start
git clone https://github.com/alecgibson/electron-quick-start
cd electron-quick-start
npm install
npm start
  1. Enable the "British" keyboard layout
  2. Start the app
  3. Use Cmd + ` to toggle between the two spawned windows
  4. Switch keyboard layout to "British - PC"
  5. Try to use Cmd + ` again, but note that the windows no longer toggle (NB - the backtick key will have moved; verify you've got the right key by trying to type it somewhere)

For completeness, here is the simple code in the repo:

const { app, BrowserWindow } = require('electron')

const windows = new Set();

function createWindow(url) {
  const window = new BrowserWindow({ width: 800, height: 600 });
  window.loadURL(url);
  windows.add(window);
  window.on('closed', () => windows.delete(window));
}

app.on('ready', () => {
  createWindow('https://electronjs.org');
  createWindow('https://github.com/electron/electron-quick-start');
});

Additional Information

This was first raised as an issue on VS Code, but it looks like it's an Electron bug: microsoft/vscode#68217

@welcome
Copy link

welcome bot commented Mar 8, 2019

👋 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.

@bengourley
Copy link

The last working version appears to be 2.0.18. Every version of Electron that I tried after that (starting with v3.0.0) cmd+backtick does not work.

@electron-triage
Copy link

Thank you for taking the time to report this issue and helping to make Electron better.

The version of Electron you reported this on has been superseded by newer releases.

If you're still experiencing this issue in Electron 6.x.y or later, please add a comment specifying the version you're testing with and any other new information that a maintainer trying to reproduce the issue should know.

I'm setting the blocked/need-info label for the above reasons. This issue will be closed 7 days from now if there is no response.

Thanks in advance! Your help is appreciated.

@electron-triage electron-triage added the blocked/need-info ❌ Cannot proceed without more information label Feb 19, 2020
@alecgibson
Copy link
Author

I've just tested this in v8.0.1, and it's still broken. Is this on anyone's radar? It's a really annoying bug.

@electron-triage electron-triage added 8-x-y and removed blocked/need-info ❌ Cannot proceed without more information labels Feb 26, 2020
@erralb
Copy link

erralb commented Feb 27, 2020

Hi, I have the same problem on a MacBook pro 16 with Catalina and a French keyboard (using VSCode)

@titouanmathis
Copy link

Hi,

Same bug for me on a Macbook Pro 13" 2017 with macOS Catalina and a French keyboard, using VSCode 1.45.1 and Electron 7.2.4.

@alecgibson alecgibson changed the title Cannot toggle windows on Mac using "British - PC" keyboard layout Cannot toggle windows on Mac using "non-standard" keyboard layouts (eg British - PC; French) May 28, 2020
@cogat
Copy link

cogat commented Sep 12, 2020

I am here hoping for a fix that helps with window switching on the Trello app. I use Dvorak keyboard layout, but switching between Dvorak and US layout doesn't seem to make a difference (backtick is in the same place on both). When I run @alecgibson's example I can't immediately switch windows with CMD+`, but after waiting about 10 seconds I suddenly can. I'm running MBP 2019 with Catalina.

@clavin
Copy link
Member

clavin commented Feb 19, 2021

It seems I fixed this issue in #27701. It took me a moment to find ` on this keyboard layout but I ran the example in this thread, confirmed it's still broken, then ran the example on a build with the fix from #27701 in it and Cmd + ` in the "British - PC" keyboard layout worked as well as the "French" keyboard layout.

@MarshallOfSound
Copy link
Member

Fixed in #27701 🥳

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

9 participants