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:
2026-05-20 20:12:33 +02:00
parent 20cfadeb0b
commit e0f8cf78ee
+4
View File
@@ -254,6 +254,10 @@ void SDLManager::toggleFullscreen() {
windowed_width_ = current_width_;
windowed_height_ = current_height_;
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);
std::cout << "F3: Fullscreen activat (guardada: "
<< windowed_width_ << "x" << windowed_height_ << ")" << '\n';