diff --git a/gdk/win32/gdkglcontext-win32.c b/gdk/win32/gdkglcontext-win32.c index 056b651355..a500ffcddc 100644 --- a/gdk/win32/gdkglcontext-win32.c +++ b/gdk/win32/gdkglcontext-win32.c @@ -937,6 +937,7 @@ gdk_win32_gl_context_realize (GdkGLContext *context, GError **error) { GdkGLContext *share = gdk_gl_context_get_shared_context (context); + GdkGLContext *shared_data_context; GdkWin32GLContext *context_win32 = GDK_WIN32_GL_CONTEXT (context); gboolean debug_bit, compat_bit, legacy_bit; @@ -955,6 +956,7 @@ gdk_win32_gl_context_realize (GdkGLContext *context, gdk_gl_context_get_required_version (context, &major, &minor); debug_bit = gdk_gl_context_get_debug_enabled (context); compat_bit = gdk_gl_context_get_forward_compatible (context); + shared_data_context = gdk_surface_get_shared_data_gl_context (surface); /* * A legacy context cannot be shared with core profile ones, so this means we @@ -1004,7 +1006,7 @@ gdk_win32_gl_context_realize (GdkGLContext *context, legacy_bit ? "yes" : "no")); hglrc = _create_gl_context (context_win32->gl_hdc, - share, + share ? share : shared_data_context, flags, major, minor, @@ -1046,7 +1048,7 @@ gdk_win32_gl_context_realize (GdkGLContext *context, ctx = _create_egl_context (win32_display->egl_disp, context_win32->egl_config, - share, + share ? share : shared_data_context, flags, major, minor,