Skip to contentSkip to conversation

Fix safeAreaInsets not being available on OS X 10.13

PATCH In review Tobias Markus 2 participants 2 messages Apr 28, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix safeAreaInsets not being available on OS X 10.13

Hello,

to prefix this: I previously filed https://gitlab.com/qemu-project/qemu/-/issues/2314 for this compilation error and I'm quite aware that QEMU only supports the most recent two versions of Mac OS X by default. However, given the small change required for this to work, I hope you can make an exception and include the attached patch into QEMU.

It would really help me continue to run QEMU on my legacy MacOS X 10.13 version.

Thanks in advance!

Kind regards,
Tobias Markus

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2314

---
 ui/cocoa.m | 2 ++

 1 file changed, 2 insertions(+)
ui/cocoa.m +0 -0
index 25e0db9dd0..96992736ef 100644
@@ -539,9 +539,11 @@ - (NSSize)fixAspectRatio:(NSSize)max

 - (NSSize) screenSafeAreaSize
 {
     NSSize size = [[[self window] screen] frame].size; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_14_0 NSEdgeInsets insets = [[[self window] screen] safeAreaInsets]; size.width -= insets.left + insets.right; size.height -= insets.top + insets.bottom;
+#endif
     return size;
 }

Signature · 1 line
2.24.3 (Apple Git-128)
#1 lore raw
Quoted 5 lines · Tobias Markus

Hello,

to prefix this: I previously filed https://gitlab.com/qemu-project/qemu/-/issues/2314 for this compilation error and I'm quite aware that QEMU only supports the most recent two versions of Mac OS X by default. However, given the small change required for this to work, I hope you can make an exception and include the attached patch into QEMU.

It would really help me continue to run QEMU on my legacy MacOS X 10.13 version.

Hi,

I'm sorry to tell this but I'm not for making an exception.

While this change is indeed small, we already have many codes that are only needed by unsupported macOS versions. They were not added to keep QEMU work with unsupported macOS versions, but they were added when those versions were still supported. Maintaining all of them is not a trivial task so they are now eligible for removal.

Regards,
Akihiko Odaki

Quoted 28 lines

Thanks in advance!

Kind regards,
Tobias Markus

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2314

---
  ui/cocoa.m | 2 ++
  1 file changed, 2 insertions(+)
ui/cocoa.m +2 -0
index 25e0db9dd0..96992736ef 100644
@@ -539,9 +539,11 @@ - (NSSize)fixAspectRatio:(NSSize)max
  - (NSSize) screenSafeAreaSize
  {
      NSSize size = [[[self window] screen] frame].size;
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_14_0
      NSEdgeInsets insets = [[[self window] screen] safeAreaInsets];
      size.width -= insets.left + insets.right;
      size.height -= insets.top + insets.bottom;
+#endif
      return size;
  }