-
Notifications
You must be signed in to change notification settings - Fork 15.2k
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
Fix frameless windows with vibrancy #11886
Conversation
108e862
to
cede986
Compare
atom/browser/native_window_mac.h
Outdated
@@ -149,6 +149,8 @@ class NativeWindowMac : public NativeWindow, | |||
|
|||
bool simple_fullscreen() const { return always_simple_fullscreen_; } | |||
|
|||
void SetRenderWidgetHostOpaque(bool opaque); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only called from within the class. Seems like it could be moved to inside the protected
block?
atom/browser/native_window_mac.mm
Outdated
impl->SetBackgroundOpaque(opaque); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty egregious demeter violation but I'm not sure what the Right Thing is here since some of these conditionals are for upstream classes out of our control 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I tried to collapse it as much as I could but everything is just consecutive potentially nullptr values 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I inverted the logic to collapse it a bit 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still like 4 steps of separation though so idk 🤔
atom/browser/native_window_mac.h
Outdated
@@ -213,6 +215,9 @@ class NativeWindowMac : public NativeWindow, | |||
NSRect original_frame_; | |||
NSUInteger simple_fullscreen_mask_; | |||
|
|||
NSColor* background_color_before_vibrancy_ = nil; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not positive but should this be a base::scoped_nsobject<NSColor>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You right 👍 😄
cede986
to
cd31f8f
Compare
@ckerr Updated 👍 |
cd31f8f
to
636f0dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks 💯 to me now!
@codebytere when do you think this will be released? |
@sallar it's on the table for 2.0, i believe, so fairly soon |
not include in 2.0 beta1? |
@HuChundong It should be, do you have a case where it's not working? |
@MarshallOfSound this main window still lose round corner in high sierra 10.13.3 |
This PR was not intended to fix the round / square corner issue. There is a separate open issue for that |
Hi, I don't know what I am doing wrong but this is still not working for me... running MacOS 10.13.3. I still get the same error of the transparent bar showing up.
|
@huangruichang @tcaer Remove |
@sallar Maybe I am not the person you wanna notice 🤣 |
@sallar No luck... I get the square corners and the invisible tab :/ |
@tcaer Can you share repro? |
@tcaer add Judging by your comments this PR fixes nothing. |
I just tested beta1. This fix changes nothing. Vibrancy+Square Corners was also possible before (using But judging by @MarshallOfSound's comment, there is a separate issue for the rounded corners... #10886 |
Also just tested and unfortunately I'm also seeing much worse behavior than before the fix. Previously there was just a transparent area where the titlebar would normally be – now it's showing corrupted artifacts and the titlebar has reverted to the standard thickness / position even with |
@tommoor Super weird, let me test this real quick 🤔 |
@tommoor Two quick things
|
Oh, interesting I did check the release notes for breaking changes and there wasn't a mention of that property being deprecated but that would explain the first part of the issue 😄. I wonder if having the deprecated option there caused it. Was the deprecation removed in 2.0? If so I guess we should add that to the notes. The screenshot doesn't capture it too well, basically the entire titlebar is showing artifacts depending on what's behind - It mostly looks black / transparent. Options are:
|
Thanks @MarshallOfSound – I'm out for the day now, but I'll try with 2.0 again tomorrow and the correct hiddenInset option, hopefully that does the trick 👍 |
@tommoor It might also be the |
Maybe, I can't really use those options as the square corners are unacceptable on macOS unfortunately 😞 |
Hm, fair enough, we had an issue somewhere for the square corner thing. Will try take a look at that later this week if I get a chance. |
Thanks so much for all the help! |
@tcaer Known bug and I think it's already fixed 😆 |
Hey guys, thanks so much for fixing this! Does this fix the corner radius bug too? In my build, the top two corners aren't rounded when I use the following settings with a webview in it #10522:
|
Rounded corners are still missing at the top edges, when vibrancy is activated. |
Fixes #10521
Tested with
setVibrancy
as well so this supports dynamically switching vibrancy still as well.