[gtk/wip/chergert/fix-4279] macos: handle NULL surface when creating GL context




commit e77eaa0acedd86371d9d81de3982d8657864915d
Author: Christian Hergert <chergert redhat com>
Date:   Tue Sep 28 17:36:23 2021 -0700

    macos: handle NULL surface when creating GL context
    
    Fixes #4279

 gdk/macos/gdkmacosglcontext.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gdk/macos/gdkmacosglcontext.c b/gdk/macos/gdkmacosglcontext.c
index 09da35b69a..77391b9eaa 100644
--- a/gdk/macos/gdkmacosglcontext.c
+++ b/gdk/macos/gdkmacosglcontext.c
@@ -226,8 +226,8 @@ gdk_macos_gl_context_real_realize (GdkGLContext  *context,
 
   swapRect[0] = 0;
   swapRect[1] = 0;
-  swapRect[2] = surface->width;
-  swapRect[3] = surface->height;
+  swapRect[2] = surface ? surface->width : 0;
+  swapRect[3] = surface ? surface->height : 0;
 
   CGLSetParameter (cgl_context, kCGLCPSwapRectangle, swapRect);
   CGLSetParameter (cgl_context, kCGLCPSwapInterval, &sync_to_framerate);


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