fix: Correct modal focus behavior on macOS (#18995)
Fixes #18502 This PR changes the focus and blur events that we emit in Electron to listen to changes in key window rather than main window. It swaps out windowDidBecomeMain and windowDidResignMain for windowDidBecomeKey and windowDidResignKey, respectively.
This commit is contained in:
parent
3173b66d00
commit
c7da54e82a
2 changed files with 30 additions and 2 deletions
|
@ -88,11 +88,11 @@ using TitleBarStyle = electron::NativeWindowMac::TitleBarStyle;
|
|||
return frame;
|
||||
}
|
||||
|
||||
- (void)windowDidBecomeMain:(NSNotification*)notification {
|
||||
- (void)windowDidBecomeKey:(NSNotification*)notification {
|
||||
shell_->NotifyWindowFocus();
|
||||
}
|
||||
|
||||
- (void)windowDidResignMain:(NSNotification*)notification {
|
||||
- (void)windowDidResignKey:(NSNotification*)notification {
|
||||
shell_->NotifyWindowBlur();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue