Commit 00834786 authored by Niels Nesse's avatar Niels Nesse Committed by Emmanuele Bassi

GDK GL context's should associate with "window->impl_window" not "window"

In some layouts this inconsistency results in crashes in
gdk_gl_texture_from_surface() since it uses gdk_gl_context_get_window() but
the returned window is not the same as the one that is being painted so
"window->current_paint.surface" is NULL. I saw this problem when packing a
GdkGLArea into a GtkPaned.

https://bugzilla.gnome.org/show_bug.cgi?id=743146
parent 27cf0fa3
......@@ -2737,7 +2737,7 @@ gdk_window_get_paint_gl_context (GdkWindow *window, GError **error)
if (window->impl_window->gl_paint_context == NULL)
{
window->impl_window->gl_paint_context =
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window,
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window,
TRUE,
GDK_GL_PROFILE_3_2_CORE,
NULL,
......@@ -2748,7 +2748,7 @@ gdk_window_get_paint_gl_context (GdkWindow *window, GError **error)
{
g_clear_error (error);
window->impl_window->gl_paint_context =
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window,
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window,
TRUE,
GDK_GL_PROFILE_DEFAULT,
NULL,
......@@ -2790,7 +2790,7 @@ gdk_window_create_gl_context (GdkWindow *window,
if (paint_context == NULL)
return NULL;
return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window,
return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window,
FALSE,
profile,
paint_context,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment