Skip to content

Commit

Permalink
Make main window owner of WAD launcher dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Sep 9, 2024
1 parent 40bdc3d commit 9ee06bb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#include <commdlg.h>
#include <mmsystem.h>
#include <ShellAPI.h>

#include "SDL_syswm.h"
#endif

#include "am_map.h"
Expand Down Expand Up @@ -1360,12 +1362,16 @@ static int D_OpenWADLauncher(void)
bool fileopenedok;

#if defined(_WIN32)
SDL_SysWMinfo info = { 0 };
OPENFILENAME ofn;
char szFile[4096];

SDL_VERSION(&info.version);
SDL_GetWindowWMInfo(window, &info);

ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = NULL;
ofn.hwndOwner = info.info.win.window;
M_StringCopy(szFile, (invalidwad ? invalidwad : wad), sizeof(szFile));
ofn.lpstrFile = szFile;
ofn.nMaxFile = sizeof(szFile);
Expand Down

0 comments on commit 9ee06bb

Please sign in to comment.