Skip to content

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

Closed

Description

@alecgibson
  • Electron Version:
    • 4.0.7
  • Operating System:
    • macOS 10.13.6
  • Last Known Working Electron version:

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

Activity

  1. welcome commented on Mar 8, 2019

    @welcome

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

  2. bengourley commented on May 7, 2019

    @bengourley

    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.

  3. electron-triage commented on Feb 19, 2020

    @electron-triage

    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.

  4. added
    blocked/need-info ❌
    on Feb 19, 2020
  5. alecgibson commented on Feb 20, 2020

    @alecgibson
    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.

  6. added and removed
    blocked/need-info ❌
    on Feb 26, 2020
  7. erralb commented on Feb 27, 2020

    @erralb

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

  8. titouanmathis commented on May 28, 2020

    @titouanmathis

    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.

  9. 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)[/+] on May 28, 2020
  10. cogat commented on Sep 12, 2020

    @cogat

    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.

  11. clavin commented on Feb 19, 2021

    @clavin
    Member

    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.

  12. MarshallOfSound commented on Feb 19, 2021

    @MarshallOfSound
    Member

    Fixed in #27701 🥳

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions