diff options
author | Bartosz Taudul <wolf.pld@gmail.com> | 2020-06-10 02:52:17 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf.pld@gmail.com> | 2020-06-10 02:52:17 +0300 |
commit | d1ef8ea90be24455acf7737ad8308f9b148aed2c (patch) | |
tree | 70317d53840b069fa0ccc25f9aa53192015ae1a6 /nfd | |
parent | 483bc3f549414974a536ca5463cb0876bdfbd141 (diff) |
Set owner of file dialogs on windows.
Diffstat (limited to 'nfd')
-rw-r--r-- | nfd/nfd.h | 6 | ||||
-rw-r--r-- | nfd/nfd_cocoa.m | 6 | ||||
-rw-r--r-- | nfd/nfd_gtk.c | 6 | ||||
-rw-r--r-- | nfd/nfd_win.cpp | 10 |
4 files changed, 18 insertions, 10 deletions
@@ -38,7 +38,8 @@ typedef enum { /* single file open dialog */ nfdresult_t NFD_OpenDialog( const nfdchar_t *filterList, const nfdchar_t *defaultPath, - nfdchar_t **outPath ); + nfdchar_t **outPath, + void* owner ); /* multiple file open dialog */ nfdresult_t NFD_OpenDialogMultiple( const nfdchar_t *filterList, @@ -48,7 +49,8 @@ nfdresult_t NFD_OpenDialogMultiple( const nfdchar_t *filterList, /* save dialog */ nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList, const nfdchar_t *defaultPath, - nfdchar_t **outPath ); + nfdchar_t **outPath, + void* owner ); /* select folder dialog */ diff --git a/nfd/nfd_cocoa.m b/nfd/nfd_cocoa.m index 39a0931d..86508d52 100644 --- a/nfd/nfd_cocoa.m +++ b/nfd/nfd_cocoa.m @@ -119,7 +119,8 @@ static nfdresult_t AllocPathSet( NSArray *urls, nfdpathset_t *pathset ) nfdresult_t NFD_OpenDialog( const nfdchar_t *filterList, const nfdchar_t *defaultPath, - nfdchar_t **outPath ) + nfdchar_t **outPath, + void* owner ) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; @@ -205,7 +206,8 @@ nfdresult_t NFD_OpenDialogMultiple( const nfdchar_t *filterList, nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList, const nfdchar_t *defaultPath, - nfdchar_t **outPath ) + nfdchar_t **outPath, + void* owner ) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSWindow *keyWindow = [[NSApplication sharedApplication] keyWindow]; diff --git a/nfd/nfd_gtk.c b/nfd/nfd_gtk.c index 7a9958ed..d0e79d08 100644 --- a/nfd/nfd_gtk.c +++ b/nfd/nfd_gtk.c @@ -167,7 +167,8 @@ static void WaitForCleanup(void) nfdresult_t NFD_OpenDialog( const nfdchar_t *filterList, const nfdchar_t *defaultPath, - nfdchar_t **outPath ) + nfdchar_t **outPath, + void* owner ) { GtkWidget *dialog; nfdresult_t result; @@ -271,7 +272,8 @@ nfdresult_t NFD_OpenDialogMultiple( const nfdchar_t *filterList, nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList, const nfdchar_t *defaultPath, - nfdchar_t **outPath ) + nfdchar_t **outPath, + void* owner ) { GtkWidget *dialog; nfdresult_t result; diff --git a/nfd/nfd_win.cpp b/nfd/nfd_win.cpp index d57065d4..87c0b130 100644 --- a/nfd/nfd_win.cpp +++ b/nfd/nfd_win.cpp @@ -364,7 +364,8 @@ static nfdresult_t SetDefaultPath( IFileDialog *dialog, const char *defaultPath nfdresult_t NFD_OpenDialog( const nfdchar_t *filterList, const nfdchar_t *defaultPath, - nfdchar_t **outPath ) + nfdchar_t **outPath, + void* owner ) { HRESULT result; nfdresult_t nfdResult = NFD_ERROR; @@ -407,7 +408,7 @@ nfdresult_t NFD_OpenDialog( const nfdchar_t *filterList, } // Show the dialog. - result = fileOpenDialog->Show(NULL); + result = fileOpenDialog->Show((HWND)owner); if ( SUCCEEDED(result) ) { // Get the file name @@ -559,7 +560,8 @@ end: nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList, const nfdchar_t *defaultPath, - nfdchar_t **outPath ) + nfdchar_t **outPath, + void* owner ) { nfdresult_t nfdResult = NFD_ERROR; @@ -600,7 +602,7 @@ nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList, } // Show the dialog. - result = fileSaveDialog->Show(NULL); + result = fileSaveDialog->Show((HWND)owner); if ( SUCCEEDED(result) ) { // Get the file name |