mirror of
https://github.com/shadps4-emu/ext-SDL.git
synced 2025-02-03 09:22:42 +00:00
video: Try to match the requested video mode when moving fullscreen windows
Try to match the requested video mode when a fullscreen window is moved to a new display, or it may not be returned to the requested mode if it is moved to a display with no matching mode, then back to the original display.
This commit is contained in:
parent
8c852f4dcf
commit
5a0095d373
@ -3229,8 +3229,8 @@ void SDL_OnWindowDisplayChanged(SDL_Window *window)
|
||||
SDL_DisplayID displayID = SDL_GetDisplayForWindowPosition(window);
|
||||
const SDL_DisplayMode *new_mode = NULL;
|
||||
|
||||
if (window->current_fullscreen_mode.pixel_w != 0 || window->current_fullscreen_mode.pixel_h != 0) {
|
||||
new_mode = SDL_GetClosestFullscreenDisplayMode(displayID, window->current_fullscreen_mode.pixel_w, window->current_fullscreen_mode.pixel_h, window->current_fullscreen_mode.refresh_rate);
|
||||
if (window->requested_fullscreen_mode.pixel_w != 0 || window->requested_fullscreen_mode.pixel_h != 0) {
|
||||
new_mode = SDL_GetClosestFullscreenDisplayMode(displayID, window->requested_fullscreen_mode.pixel_w, window->requested_fullscreen_mode.pixel_h, window->requested_fullscreen_mode.refresh_rate);
|
||||
}
|
||||
|
||||
if (new_mode) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user