macos: do not crash in mojave

The localizedName property is not available in Mojave
so just ifdef in that case the code out.
This commit is contained in:
Ignacio Casal Quinteiro 2020-12-31 11:35:04 +01:00
parent d5963ad109
commit 4ad5e77907

View File

@ -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 *