fix: modal rounding on nonmodal windows (#41003)
* fix: modal rounding on nonmodal windows * chore: feedback from review
This commit is contained in:
parent
f97d8719e6
commit
df7f07a8af
1 changed files with 7 additions and 6 deletions
|
@ -1402,14 +1402,15 @@ void NativeWindowMac::UpdateVibrancyRadii(bool fullscreen) {
|
||||||
if (vibrantView != nil && !vibrancy_type_.empty()) {
|
if (vibrantView != nil && !vibrancy_type_.empty()) {
|
||||||
const bool no_rounded_corner = !HasStyleMask(NSWindowStyleMaskTitled);
|
const bool no_rounded_corner = !HasStyleMask(NSWindowStyleMaskTitled);
|
||||||
const int macos_version = base::mac::MacOSMajorVersion();
|
const int macos_version = base::mac::MacOSMajorVersion();
|
||||||
|
const bool modal = is_modal();
|
||||||
|
|
||||||
// Modal window corners are rounded on macOS >= 11 or higher if the user
|
// If the window is modal, its corners are rounded on macOS >= 11 or higher
|
||||||
// hasn't passed noRoundedCorners.
|
// unless the user has explicitly passed noRoundedCorners.
|
||||||
bool should_round_modal =
|
bool should_round_modal =
|
||||||
!no_rounded_corner && (macos_version >= 11 ? true : !is_modal());
|
!no_rounded_corner && macos_version >= 11 && modal;
|
||||||
// Nonmodal window corners are rounded if they're frameless and the user
|
// If the window is nonmodal, its corners are rounded if it is frameless and
|
||||||
// hasn't passed noRoundedCorners.
|
// the user hasn't passed noRoundedCorners.
|
||||||
bool should_round_nonmodal = !no_rounded_corner && !has_frame();
|
bool should_round_nonmodal = !no_rounded_corner && !modal && !has_frame();
|
||||||
|
|
||||||
if (should_round_nonmodal || should_round_modal) {
|
if (should_round_nonmodal || should_round_modal) {
|
||||||
CGFloat radius;
|
CGFloat radius;
|
||||||
|
|
Loading…
Add table
Reference in a new issue