Skip to content

Commit aa9e393

Browse files
committed
[OSX] Fix Window.focus() not taking focus
FIX nwjs#2724 and also nwjs#2735
1 parent 2fc97ad commit aa9e393

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/browser/native_window_mac.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,8 @@ - (void)drawRect:(NSRect)dirtyRect {
481481
}
482482

483483
void NativeWindowCocoa::Focus(bool focus) {
484+
NSApplication *myApp = [NSApplication sharedApplication];
485+
[myApp activateIgnoringOtherApps:YES];
484486
if (focus && [window() isVisible])
485487
[window() makeKeyAndOrderFront:nil];
486488
else

0 commit comments

Comments
 (0)