Skip to content

Fix 10.12 transparent title bar, and 10.14 'transparency' issues #805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 10, 2018

Conversation

ychin
Copy link
Member

@ychin ychin commented Dec 8, 2018

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.

@ychin ychin force-pushed the fix-sierra-transparent-titlebar branch from fe67413 to 683ee77 Compare December 10, 2018 04:37
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 macvim-dev#799.
@ychin ychin force-pushed the fix-sierra-transparent-titlebar branch from 683ee77 to 55197bd Compare December 10, 2018 04:39
@ychin ychin merged commit 67754cb into macvim-dev:master Dec 10, 2018
@ychin ychin deleted the fix-sierra-transparent-titlebar branch December 10, 2018 07:25
ychin added a commit to ychin/macvim that referenced this pull request Dec 13, 2018
Vim patch 8.1.577

Targets macOS 10.8+

Features:

- The option to automatically download and install updates is now
  exposed in the preference panel. This gives you a way to uncheck it,
  as previously there was no user-visible way to do so once it's
  checked. macvim-dev#816

Fixes:

- Title bar is no longer transparent in 10.12 Sierra macvim-dev#805
- Fixed 'transparency' setting not working properly in Mojave macvim-dev#805
- Fixed setting 'fullscreen' in vimrc leading to black screen in 10.14
  Mojave if non-native fullscreen is used macvim-dev#811
- Fixed showing all black if MMUseCGLayerAlways is set in 10.14 Mojave
  macvim-dev#811
- Fixed misconfigured Python paths in default vimrc macvim-dev#812

Script interfaces have compatibility with these versions:

- Lua 5.3
- Perl 5.18
- Python2 2.7
- Python3 3.7
- Ruby 2.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Window color gets polluted by colorscheme background color in Sierra
1 participant