mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-16 23:06:03 +00:00
Fix windows created with SDL_WINDOW_MINIMIZED having inconsistent SDL_WINDOW_HIDDEN flag on Windows
- Windows created minimized are shown with SW_SHOWMINNOACTIVE which does not send WM_SHOWWINDOW leaving the window visible (but minimized) on desktop but still with the SDL_WINDOW_HIDDEN flag set. Now the hidden flag is cleared in this case but noted that this means it's not currently possible to create a window that is initially hidden that then is minimized once shown.
This commit is contained in:
@@ -567,6 +567,11 @@ int WIN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
SetWindowPos(hwnd, NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE);
|
||||
|
||||
if (window->flags & SDL_WINDOW_MINIMIZED) {
|
||||
/* TODO: We have to clear SDL_WINDOW_HIDDEN here to ensure the window flags match the window state. The
|
||||
window is already shown after this and windows with WS_MINIMIZE do not generate a WM_SHOWWINDOW. This
|
||||
means you can't currently create a window that is initially hidden and is minimized when shown.
|
||||
*/
|
||||
window->flags &= ~SDL_WINDOW_HIDDEN;
|
||||
ShowWindow(hwnd, SW_SHOWMINNOACTIVE);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user