From 6a0ef0cdbcd0d8cbc2dbbcd534a137dd5f495a81 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 9 Apr 2018 10:37:31 -0700 Subject: [PATCH] SDL: On Windows, have SDL_ShowWindow() not activate the window if the window has the WS_EX_NOACTIVATE window flag. --- src/video/windows/SDL_windowswindow.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c index b08244389..a3ac938f9 100644 --- a/src/video/windows/SDL_windowswindow.c +++ b/src/video/windows/SDL_windowswindow.c @@ -546,8 +546,17 @@ WIN_GetWindowBordersSize(_THIS, SDL_Window * window, int *top, int *left, int *b void WIN_ShowWindow(_THIS, SDL_Window * window) { - HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; - ShowWindow(hwnd, SW_SHOW); + DWORD style; + HWND hwnd; + int nCmdShow; + + hwnd = ( (SDL_WindowData *)window->driverdata )->hwnd; + nCmdShow = SW_SHOW; + style = GetWindowLong(hwnd, GWL_EXSTYLE); + if ( style & WS_EX_NOACTIVATE ) + nCmdShow = SW_SHOWNOACTIVATE; + + ShowWindow(hwnd, nCmdShow ); } void