Skip to content

Commit

Permalink
Don't resize fullscreen windows when hiding or minimizing them (thanks
Browse files Browse the repository at this point in the history
…@madewokherd!)

This has the benefit of window previews (mousing over the icon) having the correct size and contents.

Fixes libsdl-org#5320
  • Loading branch information
slouken authored and 1bsyl committed May 8, 2022
1 parent fe60637 commit 901d408
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/video/windows/SDL_windowswindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,13 @@ WIN_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display,
int x, y;
int w, h;

if (!fullscreen && (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_FULLSCREEN_DESKTOP)) != 0) {
/* Resizing the window on hide causes problems restoring it in Wine, and it's unnecessary.
* Also, Windows would preview the minimized window with the wrong size.
*/
return;
}

if (SDL_ShouldAllowTopmost() && ((window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) == (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS) || window->flags & SDL_WINDOW_ALWAYS_ON_TOP)) {
top = HWND_TOPMOST;
} else {
Expand Down

0 comments on commit 901d408

Please sign in to comment.