video: Only sync when programmatically entering/exiting fullscreen
Otherwise, the sync function can be recursively entered when the fullscreen state is updated by a window manager event.
This commit is contained in:
@@ -1754,7 +1754,6 @@ int SDL_UpdateFullscreenMode(SDL_Window *window, SDL_bool fullscreen, SDL_bool c
|
|||||||
|
|
||||||
done:
|
done:
|
||||||
window->last_fullscreen_exclusive_display = display && (window->flags & SDL_WINDOW_FULLSCREEN) && window->fullscreen_exclusive ? display->id : 0;
|
window->last_fullscreen_exclusive_display = display && (window->flags & SDL_WINDOW_FULLSCREEN) && window->fullscreen_exclusive ? display->id : 0;
|
||||||
SDL_SyncIfRequired(window);
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
@@ -2974,6 +2973,10 @@ int SDL_SetWindowFullscreen(SDL_Window *window, SDL_bool fullscreen)
|
|||||||
SDL_zero(window->current_fullscreen_mode);
|
SDL_zero(window->current_fullscreen_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret == 0) {
|
||||||
|
SDL_SyncIfRequired(window);
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user