1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Set owner of file dialogs on windows.

This commit is contained in:
Bartosz Taudul
2020-06-10 01:52:17 +02:00
parent 483bc3f549
commit d1ef8ea90b
9 changed files with 57 additions and 29 deletions
+4 -2
View File
@@ -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 */
+4 -2
View File
@@ -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];
+4 -2
View File
@@ -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;
+6 -4
View File
@@ -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