SDL icon indicating copy to clipboard operation
SDL copied to clipboard

[SDL3]SDL_SetWindowFullscreen makes the window fullscreen on the wrong monitor

Open edo9300 opened this issue 1 year ago • 3 comments

On Windows, if "Show window contents while dragging" is disabled, moving a non maximized window from one screen to another and snapping it to maximized, will make a subsequent call to SDL_SetWindowFullscreen maximize it to the monitor it was previously in, instead of the current one, this works properly on SDL2

edo9300 avatar Dec 02 '24 21:12 edo9300

Just to check, are you setting a video mode with SDL_SetWindowFullscreenMode() before entering fullscreen, or is this fullscreen desktop?

Kontrabant avatar Dec 03 '24 01:12 Kontrabant

No, it's default windowed borderless fullscreen, I'm not switching to exclusive fullscreen. If the show window contents is is enabled this issue doesn't arise instead

edo9300 avatar Dec 03 '24 03:12 edo9300

Found the issue, and working on a fix now. This uncovered an edge case on other platforms as well, where the window will be made fullscreen on the wrong display if a maximized window is moved to another display by the window manager.

Kontrabant avatar Dec 08 '24 21:12 Kontrabant

I retested this interaction on the latest sdl3 release, and it seems to be wrong again (it was working on sdl 3.1.8 and 3.1.10), but already in sdl 3.2.0 it starts behaving with this broken behaviour again

edo9300 avatar Feb 09 '25 19:02 edo9300

@Kontrabant, can you take a look?

slouken avatar Feb 10 '25 00:02 slouken

Will do.

Kontrabant avatar Feb 10 '25 13:02 Kontrabant

After dragging, the maximized window is made fullscreen on the correct display, but it is put on the wrong display when leaving fullscreen due to the fix needed for #12006. Working on it now.

Kontrabant avatar Feb 10 '25 15:02 Kontrabant

The regression should be fixed now, without regressing #12006 either.

Kontrabant avatar Feb 10 '25 20:02 Kontrabant

Can confirm it works properly on the current master branch

edo9300 avatar Feb 21 '25 17:02 edo9300