[gtk/macos-mojave] macos: do not crash in mojave




commit 4ad5e7790706924cd8a6bc5957a18d533f6808a5
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Thu Dec 31 11:35:04 2020 +0100

    macos: do not crash in mojave
    
    The localizedName property is not available in Mojave
    so just ifdef in that case the code out.

 gdk/macos/gdkmacosmonitor.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/gdk/macos/gdkmacosmonitor.c b/gdk/macos/gdkmacosmonitor.c
index fdeadadcea..ad124a9e64 100644
--- a/gdk/macos/gdkmacosmonitor.c
+++ b/gdk/macos/gdkmacosmonitor.c
@@ -145,6 +145,7 @@ GetSubpixelLayout (CGDirectDisplayID screen_id)
 static char *
 GetLocalizedName (NSScreen *screen)
 {
+#ifdef AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER
   GDK_BEGIN_MACOS_ALLOC_POOL;
 
   NSString *str;
@@ -158,6 +159,9 @@ GetLocalizedName (NSScreen *screen)
   GDK_END_MACOS_ALLOC_POOL;
 
   return g_steal_pointer (&name);
+#else
+  return NULL;
+#endif
 }
 
 static char *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]