Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cocoa: Fix recreated windows that are both borderless and resizable.
These would accidentally get a titlebar because the "borderless" style mask is zero but the resizable attribute adds a bit. I assume this happens because you used to need window decoration to resize a window in macOS, but this changed in later releases. This only caused problems when recreating a window (you had an SDL_WINDOW_OPENGL window and tried to create a Metal SDL_Renderer on it, etc). Fixes #4324.
- Loading branch information
Showing
1 changed file
with
4 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1405,7 +1405,10 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent | |
{ | ||
unsigned long style = [nswindow styleMask]; | ||
|
||
if (style == NSWindowStyleMaskBorderless) { | ||
/* NSWindowStyleMaskBorderless is zero, and it's possible to be | ||
Resizeable _and_ borderless, so we can't do a simple bitwise AND | ||
of NSWindowStyleMaskBorderless here. */ | ||
if ((style & ~NSWindowStyleMaskResizable) == NSWindowStyleMaskBorderless) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
icculus
Author
Collaborator
|
||
window->flags |= SDL_WINDOW_BORDERLESS; | ||
} else { | ||
window->flags &= ~SDL_WINDOW_BORDERLESS; | ||
|
Was there a reason you didn't use: if ((style & NSWindowStyleMaskBorderless) != 0)