libsdl-org / SDL

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

SDL should allow adjustments of NSWindow-styleMask on macOS #7499

Open DexterHaxxor opened 1 year ago

DexterHaxxor commented 1 year ago

Currently, SDL on macOS completely overwrites the styleMask on the NSWindow when the window enters and is restored from full screen.

https://github.com/libsdl-org/SDL/blob/08d5c1386e8eb468f0c66b5511c2d334e6ae0b22/src/video/cocoa/SDL_cocoawindow.m#L987 https://github.com/libsdl-org/SDL/blob/08d5c1386e8eb468f0c66b5511c2d334e6ae0b22/src/video/cocoa/SDL_cocoawindow.m#L1049

This causes an issue when I try to change the style mask. In my case, I was trying to add NSWindowStyleMaskFullSizeContentView manually by extracting the NSWindow*, along with setting titlebarAppearsTransparent to remove the title bar, which is a nice visual touch when playing games in windowed mode.

My proposed solution is to save the styleMask before the window is about to enter full screen and then restore the value when it leaves full screen again, but I'm sure it's not the only one.

slouken commented 1 month ago

We are scoping work for the SDL 3.2.0 release, so please let us know if this is a showstopper for you.

slouken commented 1 month ago

(also, if you have a fix, please feel free to create a PR)