wayland: Apply exclusive fullscreen parameters if changed between the initial fullscreen call and the fullscreen configure event

main
Frank Praznik 2024-04-10 14:14:21 -04:00
parent 26d3cbee79
commit 037a62add5
2 changed files with 6 additions and 1 deletions

View File

@ -557,6 +557,7 @@ static void SetFullscreen(SDL_Window *window, struct wl_output *output)
return; /* Can't do anything yet, wait for ShowWindow */
}
wind->fullscreen_exclusive = output ? window->fullscreen_exclusive : SDL_FALSE;
++wind->fullscreen_deadline_count;
if (output) {
Wayland_SetWindowResizable(SDL_GetVideoDevice(), window, SDL_TRUE);
@ -573,6 +574,7 @@ static void SetFullscreen(SDL_Window *window, struct wl_output *output)
return; /* Can't do anything yet, wait for ShowWindow */
}
wind->fullscreen_exclusive = output ? window->fullscreen_exclusive : SDL_FALSE;
++wind->fullscreen_deadline_count;
if (output) {
Wayland_SetWindowResizable(SDL_GetVideoDevice(), window, SDL_TRUE);
@ -604,8 +606,10 @@ static void UpdateWindowFullscreen(SDL_Window *window, SDL_bool fullscreen)
/* Unconditionally set the output for exclusive fullscreen windows when entering
* fullscreen from a compositor event, as where the compositor will actually
* place the fullscreen window is unknown.
*
* If the higher level
*/
if (window->fullscreen_exclusive && !wind->fullscreen_was_positioned) {
if (window->fullscreen_exclusive && (!wind->fullscreen_exclusive || !wind->fullscreen_was_positioned)) {
SDL_VideoDisplay *disp = SDL_GetVideoDisplay(window->current_fullscreen_mode.displayID);
if (disp) {
wind->fullscreen_was_positioned = SDL_TRUE;

View File

@ -167,6 +167,7 @@ struct SDL_WindowData
SDL_bool suspended;
SDL_bool active;
SDL_bool is_fullscreen;
SDL_bool fullscreen_exclusive;
SDL_bool drop_fullscreen_requests;
SDL_bool fullscreen_was_positioned;
SDL_bool show_hide_sync_required;