Merge branch 'wip/chergert/fix-4279' into 'master'

macos: handle NULL surface when creating GL context

Closes #4279

See merge request GNOME/gtk!4008
This commit is contained in:
Matthias Clasen 2021-09-29 01:22:35 +00:00
commit 18c9727a98

View File

@ -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);