[gtk/gtk-3-24: 2/5] Use [NSGraphicsContext CGContext] instead of graphicsPort after Yosemite.



commit 35d798dd3145b8dc1572ae25fd1da66fb3d9406f
Author: John Ralls <jralls ceridwen us>
Date:   Mon Oct 15 10:45:57 2018 -0700

    Use [NSGraphicsContext CGContext] instead of graphicsPort after Yosemite.

 gdk/quartz/gdkwindow-quartz.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 4ffbae047d..c7fe68848a 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -137,8 +137,10 @@ gdk_window_impl_quartz_get_context (GdkWindowImplQuartz *window_impl,
       if (![window_impl->view lockFocusIfCanDraw])
         return NULL;
     }
-
-  cg_context = [[NSGraphicsContext currentContext] graphicsPort];
+  if (gdk_quartz_osx_version () < GDK_OSX_YOSEMITE)
+       cg_context = [[NSGraphicsContext currentContext] graphicsPort];
+  else
+       cg_context = [[NSGraphicsContext currentContext] CGContext];
   CGContextSaveGState (cg_context);
   CGContextSetAllowsAntialiasing (cg_context, antialias);
 


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