mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
windows: Don't allow non-resizable windows to be maximized.
Fixes #6346.
(cherry picked from commit d275851dfb
)
This commit is contained in:
@@ -928,11 +928,16 @@ void WIN_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
|
||||
void WIN_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
SDL_WindowData *data = window->driverdata;
|
||||
HWND hwnd = data->hwnd;
|
||||
data->expected_resize = SDL_TRUE;
|
||||
ShowWindow(hwnd, SW_MAXIMIZE);
|
||||
data->expected_resize = SDL_FALSE;
|
||||
/* Other platforms refuse to maximize a non-resizable window, and with win32,
|
||||
the OS resizes the window weirdly (covering the taskbar) if you don't have
|
||||
the STYLE_RESIZABLE flag set. So just forbid it for now. */
|
||||
if (window->flags & SDL_WINDOW_RESIZABLE) {
|
||||
SDL_WindowData *data = window->driverdata;
|
||||
HWND hwnd = data->hwnd;
|
||||
data->expected_resize = SDL_TRUE;
|
||||
ShowWindow(hwnd, SW_MAXIMIZE);
|
||||
data->expected_resize = SDL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void WIN_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
|
Reference in New Issue
Block a user