fix: prevent settings window flash when whisper overlay opens#446
Merged
shobhit99 merged 3 commits intoMay 29, 2026
Merged
Conversation
When the settings (or canvas/extension-store) window was previously opened, the app is in macOS regular activation mode. Creating the detached whisper popup via window.open() with show:true activates the app on macOS, raising all existing windows to the foreground and causing a visible flash of the settings window before the alwaysOnTop whisper popup renders. Fix by creating the whisper popup hidden (show:false) and then calling showInactive() after setting up ignore-mouse-events in did-create-window. showInactive() maps to NSWindow orderFrontRegardless: on macOS, which orders the window in front without making it key or activating the application — preventing the settings window from being raised.
890014d to
9f93467
Compare
Contributor
|
@monotykamary can you resolve the conflicts |
Contributor
Author
|
oh just noticed, gimme a hot min 🚐 |
Contributor
Author
|
@shobhit99 all good 🫡 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the settings window (or canvas/extension-store window) was previously opened, pressing the whisper hotkey causes a brief flash of the settings window before the whisper overlay appears.
Root Cause
When
openSettingsWindow()is called, it switches the SuperCmd app to macOS "regular" activation mode (setMacActivationPolicy("regular")), which makes the app appear in the Dock and Cmd+Tab.When the whisper hotkey is pressed, the renderer calls
window.open()to create the detached whisper popup. Electron intercepts this viasetWindowOpenHandlerand creates a newBrowserWindowwithshow: true. On macOS,show: truecallsmakeKeyAndOrderFront:which activates the application, raising all existing app windows to the foreground — including the settings window. The user sees the settings window flash into view before thealwaysOnTop: truewhisper popup renders on top.Fix
Change the whisper popup creation to use
show: falseand then callshowInactive()after setting upsetIgnoreMouseEvents(true)in thedid-create-windowhandler.showInactive()maps toNSWindow orderFrontRegardless:on macOS, which orders the window in front without making it key or activating the application. This prevents macOS from raising the settings window when the whisper popup appears.This approach:
Changes
src/main/main.ts:setWindowOpenHandler: changedshow: truetoshow: detachedPopupName !== DETACHED_WHISPER_WINDOW_NAMEso the whisper popup is created hiddendid-create-window: addedchildWindow.showInactive()aftersetIgnoreMouseEvents(true)for the whisper popup, showing it without activating the appTesting