libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
10.14k stars 1.85k forks source link

[SDL3] Losing focus from a fullscreen window on macOS resets it back to windowed mode #11494

Closed frenzibyte closed 3 days ago

frenzibyte commented 4 days ago

This can be replicated directly by testwm:

https://github.com/user-attachments/assets/11aa62b8-e7ec-43de-81c5-4d363ec49969

Steps:

  1. Run testwm and set to fullscreen using Ctrl+Enter
  2. Kill focus by CMD-Tab or otherwise
  3. Go back to the testwm window

Notice the window has reset back to windowed mode and the FULLSCREEN window flag has been removed.

Kontrabant commented 3 days ago

What version of macOS is this happening on? On 14.5 it works correctly: alt-tabbing away from the fullscreen windows will take it out of fullscreen and minimize it, then alt-tabbing back will unminimize it and put it back into fullscreen.

frenzibyte commented 3 days ago

I'm using macOS Sequoia 15.1.

alt-tabbing away from the fullscreen windows will take it out of fullscreen and minimize it, then alt-tabbing back will unminimize it and put it back into fullscreen.

Interesting, I vaguely remember that's how it used to work as well, seems like it may have broke in Sequoia indeed.

Kontrabant commented 3 days ago

I updated to Sequoia and can reproduce this. It seems that Sequoia won't minimize the window when leaving fullscreen unless it is briefly made key again. Moving the miniaturization request to later in the fullscreen switching function seems to fix this.

We should also probably also check for a pending fullscreen restoration flag on focus restoration, so fullscreen is still restored with focus just in case the miniaturization request fails.

frenzibyte commented 3 days ago

Thank you for this quick response and action!