fix(fullscreen): seleccionar mode 'borderless desktop' explícitament en toggleFullscreen
A SDL3, SDL_SetWindowFullscreen(true) sol hereta el SDL_DisplayMode que tingués la finestra. Sense una crida prèvia a SDL_SetWindowFullscreenMode(win, nullptr), el comportament és no determinista entre invocacions (i pot acabar en mode exclusiu si abans hi havia hagut un mode setejat). Afegim la crida amb mode=nullptr just abans d'activar el fullscreen perquè sempre entrem en "borderless desktop" (cobrint el monitor on viu la finestra).
This commit is contained in:
@@ -254,6 +254,10 @@ void SDLManager::toggleFullscreen() {
|
|||||||
windowed_width_ = current_width_;
|
windowed_width_ = current_width_;
|
||||||
windowed_height_ = current_height_;
|
windowed_height_ = current_height_;
|
||||||
is_fullscreen_ = true;
|
is_fullscreen_ = true;
|
||||||
|
// SDL3: cal seleccionar explícitament el mode "borderless desktop"
|
||||||
|
// (mode=nullptr) abans d'activar el fullscreen. Sense això, el
|
||||||
|
// comportament depèn del mode que tingués la finestra anteriorment.
|
||||||
|
SDL_SetWindowFullscreenMode(finestra_, nullptr);
|
||||||
SDL_SetWindowFullscreen(finestra_, true);
|
SDL_SetWindowFullscreen(finestra_, true);
|
||||||
std::cout << "F3: Fullscreen activat (guardada: "
|
std::cout << "F3: Fullscreen activat (guardada: "
|
||||||
<< windowed_width_ << "x" << windowed_height_ << ")" << '\n';
|
<< windowed_width_ << "x" << windowed_height_ << ")" << '\n';
|
||||||
|
|||||||
Reference in New Issue
Block a user