Fix 10.12 transparent title bar, and 10.14 'transparency' issues #805
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix 10.12 transparent title bar, and 10.14 'transparency' issues
Change the code that sets window's backgroundColor to Mojave (10.14) only. Right now, we are creating windows with the flag NSWindowStyleMaskTexturedBackground which is actually deprecated, and it had the annoying effect of auto-setting transparent title bars in Sierra SDKs. When the previous change set the background color of the window it also made the title bar color change as well. Now, the background color is only set for Mojave so those earlier platforms won't be affected.
Also fix the 'transparency' setting in Mojave. Since in Mojave the rendering is done through layers now, we need to make sure the layers are all transparent other than the text view that's trying to blend on top of the desktop (this is why we needed to set the window background color to begin with). There is one hack where we have to set the window background with 0.001 alpha because if you set to 0, the whole border disappears the the window behaves sluggishly.
In the future, consider removing NSWindowStyleMaskTexturedBackground since it's been deprecated for a while. One issue is that without it the system title bar has this annoying gray/black line and it doesn't look as neat. It's a minor aesthetics issue though and if in the future it gets completely deprecated it's not a big deal. Alternatively, consider using a transparent title bar and use customized theming.
Also, fix a regression where zoom button was not working properly in pre-Mojave, due to [NSAnimationContext beginGrouping] being improperly called.
Fix #799.