summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgnacio Casal Quinteiro <qignacio@amazon.com>2020-12-31 11:35:04 +0100
committerIgnacio Casal Quinteiro <qignacio@amazon.com>2020-12-31 11:35:04 +0100
commit4ad5e7790706924cd8a6bc5957a18d533f6808a5 (patch)
treeac270b2518c379d52cf4663337fb83c20bc8bd9d
parentd5963ad1092457dd94df5e9cc67f3c368700168e (diff)
downloadgtk+-4ad5e7790706924cd8a6bc5957a18d533f6808a5.tar.gz
macos: do not crash in mojavemacos-mojave
The localizedName property is not available in Mojave so just ifdef in that case the code out.
-rw-r--r--gdk/macos/gdkmacosmonitor.c4
1 files changed, 4 insertions, 0 deletions
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 *