[Adding a few more Ccs]

17.02.2024 18:58, David Parsons :
macOS Sonoma changes the NSView.clipsToBounds to false by default where it was 
true in
earlier version of macOS. This causes the window contents to be obscured by the 
window
frame. This fixes the issue by conditionally setting the clipping on Sonoma to 
true.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1994
Signed-off-by: David Parsons <d...@daveparsons.net>

diff --git a/ui/cocoa.m b/ui/cocoa.m
index eb99064bee..c9e3b96004 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -365,6 +365,9 @@ - (id)initWithFrame:(NSRect)frameRect
          screen.width = frameRect.size.width;
          screen.height = frameRect.size.height;
          kbd = qkbd_state_init(dcl.con);
+        if (@available(macOS 14, *)) {
+            [self setClipsToBounds:YES];
+        }
}
      return self;


Hi David!

While the code change is tiny, I for one know nothing about MacOS and
its cocoa thing, so to me (with my trivial-patches hat on) this is a
no-go.  I'd love to have a review from someone more knowlegeable in
this area.

Thanks,

/mjt

Reply via email to