From: Christian Hergert Date: Mon, 28 Feb 2022 19:29:24 +0000 (-0800) Subject: macos: external access to display name helpers X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~19^2~3^2~7^2~37 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=590a1c2f3adc8228c1e80f0a2264bbf5ad633593;p=gtk4.git macos: external access to display name helpers These can be handy to print debug information when we don't have a GdkMacosMonitor to work with. --- diff --git a/gdk/macos/gdkmacosmonitor-private.h b/gdk/macos/gdkmacosmonitor-private.h index fee511d057..88f586813e 100644 --- a/gdk/macos/gdkmacosmonitor-private.h +++ b/gdk/macos/gdkmacosmonitor-private.h @@ -29,6 +29,8 @@ G_BEGIN_DECLS +char *_gdk_macos_monitor_get_localized_name (NSScreen *screen); +char *_gdk_macos_monitor_get_connector_name (CGDirectDisplayID screen_id); GdkMacosMonitor *_gdk_macos_monitor_new (GdkMacosDisplay *display, CGDirectDisplayID screen_id); CGDirectDisplayID _gdk_macos_monitor_get_screen_id (GdkMacosMonitor *self); diff --git a/gdk/macos/gdkmacosmonitor.c b/gdk/macos/gdkmacosmonitor.c index 3773ec5355..bfec76b7ef 100644 --- a/gdk/macos/gdkmacosmonitor.c +++ b/gdk/macos/gdkmacosmonitor.c @@ -160,8 +160,8 @@ GetSubpixelLayout (CGDirectDisplayID screen_id) return GDK_SUBPIXEL_LAYOUT_UNKNOWN; } -static char * -GetLocalizedName (NSScreen *screen) +char * +_gdk_macos_monitor_get_localized_name (NSScreen *screen) { #ifdef AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER GDK_BEGIN_MACOS_ALLOC_POOL; @@ -182,8 +182,8 @@ GetLocalizedName (NSScreen *screen) #endif } -static char * -GetConnectorName (CGDirectDisplayID screen_id) +char * +_gdk_macos_monitor_get_connector_name (CGDirectDisplayID screen_id) { guint unit = CGDisplayUnitNumber (screen_id); return g_strdup_printf ("unit-%u", unit); @@ -306,8 +306,8 @@ _gdk_macos_monitor_reconfigure (GdkMacosMonitor *self) pixel_width = CGDisplayModeGetPixelWidth (mode); has_opengl = CGDisplayUsesOpenGLAcceleration (self->screen_id); subpixel_layout = GetSubpixelLayout (self->screen_id); - name = GetLocalizedName (screen); - connector = GetConnectorName (self->screen_id); + name = _gdk_macos_monitor_get_localized_name (screen); + connector = _gdk_macos_monitor_get_connector_name (self->screen_id); if (width != 0 && pixel_width != 0) scale_factor = MAX (1, pixel_width / width);