Skip to content
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: modal rounding on nonmodal windows #41037

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 7 additions & 6 deletions shell/browser/native_window_mac.mm
Expand Up @@ -1401,14 +1401,15 @@ void ReorderChildWindowAbove(NSWindow* child_window, NSWindow* other_window) {
if (vibrantView != nil && !vibrancy_type_.empty()) {
const bool no_rounded_corner = !HasStyleMask(NSWindowStyleMaskTitled);
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
// hasn't passed noRoundedCorners.
// If the window is modal, its corners are rounded on macOS >= 11 or higher
// unless the user has explicitly passed noRoundedCorners.
bool should_round_modal =
!no_rounded_corner && (macos_version >= 11 ? true : !is_modal());
// Nonmodal window corners are rounded if they're frameless and the user
// hasn't passed noRoundedCorners.
bool should_round_nonmodal = !no_rounded_corner && !has_frame();
!no_rounded_corner && macos_version >= 11 && modal;
// If the window is nonmodal, its corners are rounded if it is frameless and
// the user hasn't passed noRoundedCorners.
bool should_round_nonmodal = !no_rounded_corner && !modal && !has_frame();

if (should_round_nonmodal || should_round_modal) {
CGFloat radius;
Expand Down