From 6c6f95125495a625dfc9facd9e16cd0ac57614fd Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Tue, 16 Feb 2021 01:40:02 +0300
Subject: [PATCH] DX5_CreateWindow: retrieve SDL_WINDOWID env var after
SDL_RegisterApp()
---
src/video/windx5/SDL_dx5events.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/video/windx5/SDL_dx5events.c b/src/video/windx5/SDL_dx5events.c
index 82c54fa2..284cd9f1 100644
--- a/src/video/windx5/SDL_dx5events.c
+++ b/src/video/windx5/SDL_dx5events.c
@@ -933,7 +933,7 @@ static SDL_keysym *TranslateKey(UINT scancode, SDL_keysym *keysym, int pressed)
int DX5_CreateWindow(_THIS)
{
- char *windowid = SDL_getenv("SDL_WINDOWID");
+ char *windowid;
int i;
/* Clear out DirectInput variables in case we fail */
@@ -945,6 +945,7 @@ int DX5_CreateWindow(_THIS)
SDL_RegisterApp(NULL, 0, 0);
+ windowid = SDL_getenv("SDL_WINDOWID");
SDL_windowid = (windowid != NULL);
if ( SDL_windowid ) {
#ifdef _WIN64