fix: make window without rounded corners closable (#32597)
This commit is contained in:
parent
a0b7e30fe7
commit
1cf36822e3
3 changed files with 25 additions and 5 deletions
|
@ -295,12 +295,12 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options,
|
|||
|
||||
NSUInteger styleMask = NSWindowStyleMaskTitled;
|
||||
|
||||
// The NSWindowStyleMaskFullSizeContentView style removes rounded corners
|
||||
// for framless window.
|
||||
// Removing NSWindowStyleMaskTitled removes window title, which removes
|
||||
// rounded corners of window.
|
||||
bool rounded_corner = true;
|
||||
options.Get(options::kRoundedCorners, &rounded_corner);
|
||||
if (!rounded_corner && !has_frame())
|
||||
styleMask = NSWindowStyleMaskFullSizeContentView;
|
||||
styleMask = 0;
|
||||
|
||||
if (minimizable)
|
||||
styleMask |= NSMiniaturizableWindowMask;
|
||||
|
@ -1350,7 +1350,7 @@ void NativeWindowMac::UpdateVibrancyRadii(bool fullscreen) {
|
|||
|
||||
if (vibrantView != nil && !vibrancy_type_.empty()) {
|
||||
const bool no_rounded_corner =
|
||||
[window_ styleMask] & NSWindowStyleMaskFullSizeContentView;
|
||||
!([window_ styleMask] & NSWindowStyleMaskTitled);
|
||||
if (!has_frame() && !is_modal() && !no_rounded_corner) {
|
||||
CGFloat radius;
|
||||
if (fullscreen) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue