Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/nfd
diff options
context:
space:
mode:
authorBartosz Taudul <wolf.pld@gmail.com>2020-06-10 02:52:17 +0300
committerBartosz Taudul <wolf.pld@gmail.com>2020-06-10 02:52:17 +0300
commitd1ef8ea90be24455acf7737ad8308f9b148aed2c (patch)
tree70317d53840b069fa0ccc25f9aa53192015ae1a6 /nfd
parent483bc3f549414974a536ca5463cb0876bdfbd141 (diff)
Set owner of file dialogs on windows.
Diffstat (limited to 'nfd')
-rw-r--r--nfd/nfd.h6
-rw-r--r--nfd/nfd_cocoa.m6
-rw-r--r--nfd/nfd_gtk.c6
-rw-r--r--nfd/nfd_win.cpp10
4 files changed, 18 insertions, 10 deletions
diff --git a/nfd/nfd.h b/nfd/nfd.h
index 74c92743..7a1e5601 100644
--- a/nfd/nfd.h
+++ b/nfd/nfd.h
@@ -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