Bladeren bron

Fixed restoring window size when coming out of fullscreen desktop mode.
Use the style of the window as it will be, not as it currently is at the
time of the AdjustWindowRect call.

Sam Lantinga 8 jaren geleden
bovenliggende
commit
1bfe6d6026
1 gewijzigde bestanden met toevoegingen van 4 en 1 verwijderingen
  1. 4 1
      src/video/windows/SDL_windowswindow.c

+ 4 - 1
src/video/windows/SDL_windowswindow.c

@@ -595,6 +595,8 @@ WIN_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display,
             style &= ~WS_MAXIMIZE;
             style &= ~WS_MAXIMIZE;
         }
         }
     } else {
     } else {
+        BOOL menu;
+
         /* Restore window-maximization state, as applicable.
         /* Restore window-maximization state, as applicable.
            Special care is taken to *not* do this if and when we're
            Special care is taken to *not* do this if and when we're
            alt-tab'ing away (to some other window; as indicated by
            alt-tab'ing away (to some other window; as indicated by
@@ -606,7 +608,8 @@ WIN_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display,
             data->windowed_mode_was_maximized = SDL_FALSE;
             data->windowed_mode_was_maximized = SDL_FALSE;
         }
         }
 
 
-        WIN_AdjustWindowRect(window, &x, &y, &w, &h, SDL_FALSE);
+        menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
+        WIN_AdjustWindowRectWithStyle(window, style, menu, &x, &y, &w, &h, SDL_FALSE);
     }
     }
     SetWindowLong(hwnd, GWL_STYLE, style);
     SetWindowLong(hwnd, GWL_STYLE, style);
     data->expected_resize = SDL_TRUE;
     data->expected_resize = SDL_TRUE;