diff --git a/lcl/interfaces/cocoa/cocoa_extra.pas b/lcl/interfaces/cocoa/cocoa_extra.pas index 838366e6a5..ea08abc9dd 100644 --- a/lcl/interfaces/cocoa/cocoa_extra.pas +++ b/lcl/interfaces/cocoa/cocoa_extra.pas @@ -248,6 +248,7 @@ const NSAppKitVersionNumber10_13 = 1561; //NSAppKitVersionNumber10_14 = 1641.10; // Mojave's beta? NSAppKitVersionNumber10_14 = 1671; + NSAppKitVersionNumber11_0 = 2022; // 2000 starts with beta? diff --git a/lcl/interfaces/cocoa/cocoawsdialogs.pas b/lcl/interfaces/cocoa/cocoawsdialogs.pas index 4b887971ca..27d23861a9 100644 --- a/lcl/interfaces/cocoa/cocoawsdialogs.pas +++ b/lcl/interfaces/cocoa/cocoawsdialogs.pas @@ -291,7 +291,12 @@ var lDialogView := NSView(ASaveOwner.contentView); if lDialogView <> nil then begin - if lDialogView.frame.size.width > INT_MIN_ACCESSORYVIEW_WIDTH then + if (NSAppkitVersionNumber >= NSAppKitVersionNumber11_0) then + // starting with Big Sur, the dialog retains the last openned size + // causing the width to be increased on every openning of the dialog + // we'd simply force the lAccessoryWidth to start with the minimum width + lAccessoryWidth := INT_MIN_ACCESSORYVIEW_WIDTH + else if lDialogView.frame.size.width > INT_MIN_ACCESSORYVIEW_WIDTH then lAccessoryWidth := Round(lDialogView.frame.size.width); end; lRect := GetNSRect(0, 0, lAccessoryWidth, 30);