Skip to content

Commit

Permalink
Issue #7 focus for Mac Window fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mlabbe committed Aug 15, 2016
1 parent a2f799b commit 6527087
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/nfd_cocoa.m
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ nfdresult_t NFD_OpenDialog( const char *filterList,
nfdchar_t **outPath )
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];


NSWindow *keyWindow = [[NSApplication sharedApplication] keyWindow];
NSOpenPanel *dialog = [NSOpenPanel openPanel];
[dialog setAllowsMultipleSelection:NO];

Expand Down Expand Up @@ -152,6 +153,7 @@ nfdresult_t NFD_OpenDialog( const char *filterList,
}
[pool release];

[keyWindow makeKeyAndOrderFront:nil];
return nfdResult;
}

Expand Down

0 comments on commit 6527087

Please sign in to comment.