mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-03 08:40:59 +00:00
OSX: Set focus back to the ScummVM window when closing the native file browser
This commit is contained in:
parent
b8c2f26098
commit
6162cd1c19
@ -33,6 +33,7 @@
|
||||
|
||||
#include <AppKit/NSNibDeclarations.h>
|
||||
#include <AppKit/NSOpenPanel.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSButton.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSURL.h>
|
||||
@ -125,6 +126,8 @@ int BrowserDialog::runModal() {
|
||||
// Temporarily show the real mouse
|
||||
CGDisplayShowCursor(kCGDirectMainDisplay);
|
||||
|
||||
NSWindow *keyWindow = [[NSApplication sharedApplication] keyWindow];
|
||||
|
||||
NSOpenPanel *panel = [NSOpenPanel openPanel];
|
||||
[panel setCanChooseFiles:!_isDirBrowser];
|
||||
[panel setCanChooseDirectories:_isDirBrowser];
|
||||
@ -171,6 +174,8 @@ int BrowserDialog::runModal() {
|
||||
[showHiddenFilesButton release];
|
||||
[showHiddenFilesController release];
|
||||
|
||||
[keyWindow makeKeyAndOrderFront:nil];
|
||||
|
||||
// While the native macOS file browser is open, any input events (e.g. keypresses) are
|
||||
// still received by the NSApplication. With SDL backend for example this results in the
|
||||
// events beeing queued and processed after we return, thus dispatching events that were
|
||||
|
Loading…
x
Reference in New Issue
Block a user