Cocoa: Fix clearing of unrelated window style bits

Whenever GLFW changed the window style mask, a new mask was created
from scratch based on the attributes set on the GLFW window object.
This caused us to potentially clear unrelated window style bits.

This was always wrong but became a critical issue when Cocoa began
throwing an exception if an application cleared the
NSWindowStyleMaskFullScreen while the window is in macOS fullscreen.

This commit reworks all style mask editing so it only changes the
relevant bits, preserving all others.

This is only a narrow bug fix to prevent crashes, intended for the
stable branch.  Our interaction with macOS fullscreen is still very
poor.  The next step after this is a set of patches that improve the
interaction between the current API and macOS fullscreen.

Fixes #1886
Fixes #2110
This commit is contained in:
Camilla Löwy
2022-07-01 18:19:19 +02:00
parent 6f8ec4075b
commit 0d599026d0
3 changed files with 60 additions and 26 deletions

View File

@@ -84,6 +84,7 @@ video tutorials.
- heromyth
- Lucas Hinderberger
- Paul Holden
- Hajime Hoshi
- Warren Hu
- Charles Huber
- Brent Huisman
@@ -149,6 +150,7 @@ video tutorials.
- James Murphy
- Julian Møller
- ndogxj
- F. Nedelec
- n3rdopolis
- Kristian Nielsen
- Kamil Nowakowski