From 473aceea68b8b947e33a735aece5054a2f43a3a8 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 4 Feb 2022 09:45:55 -0800 Subject: [PATCH] macos: add API to get monitor colorspace --- gdk/macos/gdkmacosmonitor-private.h | 9 +++++---- gdk/macos/gdkmacosmonitor.c | 8 ++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/gdk/macos/gdkmacosmonitor-private.h b/gdk/macos/gdkmacosmonitor-private.h index 3c6f058bd0..e15f17352d 100644 --- a/gdk/macos/gdkmacosmonitor-private.h +++ b/gdk/macos/gdkmacosmonitor-private.h @@ -29,10 +29,11 @@ G_BEGIN_DECLS -GdkMacosMonitor *_gdk_macos_monitor_new (GdkMacosDisplay *display, - CGDirectDisplayID screen_id); -CGDirectDisplayID _gdk_macos_monitor_get_screen_id (GdkMacosMonitor *self); -gboolean _gdk_macos_monitor_reconfigure (GdkMacosMonitor *self); +GdkMacosMonitor *_gdk_macos_monitor_new (GdkMacosDisplay *display, + CGDirectDisplayID screen_id); +CGDirectDisplayID _gdk_macos_monitor_get_screen_id (GdkMacosMonitor *self); +gboolean _gdk_macos_monitor_reconfigure (GdkMacosMonitor *self); +CGColorSpaceRef _gdk_macos_monitor_copy_colorspace (GdkMacosMonitor *self); G_END_DECLS diff --git a/gdk/macos/gdkmacosmonitor.c b/gdk/macos/gdkmacosmonitor.c index a68668ced9..413b8f8c25 100644 --- a/gdk/macos/gdkmacosmonitor.c +++ b/gdk/macos/gdkmacosmonitor.c @@ -298,3 +298,11 @@ _gdk_macos_monitor_get_screen_id (GdkMacosMonitor *self) return self->screen_id; } + +CGColorSpaceRef +_gdk_macos_monitor_copy_colorspace (GdkMacosMonitor *self) +{ + g_return_val_if_fail (GDK_IS_MACOS_MONITOR (self), NULL); + + return CGDisplayCopyColorSpace (self->screen_id); +}