Repository navigation
fix: restore window event redispatching on mac - #27701
Conversation
|
💖 Thanks for opening this pull request! 💖 We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix. Examples of commit messages with semantic prefixes:
Things that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
|
|
2f791de to
b31217a
Compare
|
Alright, this new solution uses the In the future, a refactor could simplify the code here by changing detatched devtools windows to inherit from I couldn't figure out a way to test this & couldn't find any tests for this functionality in the chromium source, so I haven't added any tests in this PR. |
|
Just to 🧠 brain dump in a more digestible way: This is what the inheritance looked like1 before #6016: In this version, certain key shortcuts2 like Ctrl + F2 were getting lost and not carrying out their expected functionality. In Chromium, this issue is handled by a class called So, this original issue was fixed in #6068 by introducing a new class called This A few years later, a refactor in #12696 changed the inheritance of windows created by apps: This refactored It is important to note here that This PR takes the simplest route to fix #27268: The code where redispatching actually happens is extended to also recognize windows that have a An alternate routeThis PR opts to take a simple path to fix a simple oversight in a refactor. However, this issue could also be fixed by having detatched devtools windows implemented as a window with a What codebase does X come from?Electron:
Chromium:
Notes1 Some parts of the chain are left out of each image, e.g. 2 The only shortcut that I could find that failed like this was Ctrl + F2, which focuses the menu bar/apple logo on macOS. Other related shortcuts, like Ctrl + F3 (focuses the dock) or Cmd + ` (switches between windows in the same app) mysteriously work without this event redispatching. 3 I do not know why this fixes the issue, but it does. |
|
Very nice investigation 👍 ! |
|
Congrats on merging your first pull request! 🎉🎉🎉 |
|
Release Notes Persisted
|
|
I was unable to backport this PR to "10-x-y" cleanly; |
|
I was unable to backport this PR to "11-x-y" cleanly; |
|
I have automatically backported this PR to "12-x-y", please check out #27769 |
|
Is there any plan to backport this to 9-x-y? |
|
@mxdbx I'm not planning on it since that version of electron is |




Description of Change
A past refactor of what is now
ElectronNSWindowremovedEventDispatchingWindowfrom its inheritance chain, without also addingElectronNSWindowwhereEventDispatchingWindowwas previously used. This small change restores that functionality toElectronNSWindow.Fixes #27268 which is a modern duplicate of #6016 which was fixed in #6068 but then became unfixed in #12696 and has been (presumably) broken ever since.
cc @MarshallOfSound
Checklist
Release Notes
Notes: Fixed OS-level shortcuts on macOS (e.g. Ctrl + F2, ⌘ + ~).