summaryrefslogtreecommitdiff
path: root/gdk/win32
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2021-09-17 11:09:23 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2021-09-17 11:19:30 +0800
commit75aa1a757b17eb8cef0d2cc23eca56d47e3ee45a (patch)
tree75b921babe30759d0b7344a79c7605f166529672 /gdk/win32
parent362208523d0ff83eecccacc3bd93cb7e19a7bbff (diff)
downloadgtk+-75aa1a757b17eb8cef0d2cc23eca56d47e3ee45a.tar.gz
gdkglcontext-win32-wgl.c: Fix Cairo fallback check
We were setting the WGL pixel format in GdkWin32Display too early, so the code does not bail out correctly when we retry establishing the WGL context. Fix this by pushing back setting the WGL pixel format only after it passes the shader availability check. Should fix issue #4257.
Diffstat (limited to 'gdk/win32')
-rw-r--r--gdk/win32/gdkglcontext-win32-wgl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdk/win32/gdkglcontext-win32-wgl.c b/gdk/win32/gdkglcontext-win32-wgl.c
index 3d05fb8907..010436bd3e 100644
--- a/gdk/win32/gdkglcontext-win32-wgl.c
+++ b/gdk/win32/gdkglcontext-win32-wgl.c
@@ -288,7 +288,6 @@ gdk_win32_display_init_wgl (GdkDisplay *display,
return FALSE;
}
- display_win32->wgl_pixel_format = best_idx;
display_win32->gl_version = epoxy_gl_version ();
/* We must have OpenGL/WGL 2.0 or later, or have the GL_ARB_shader_objects extension */
@@ -307,6 +306,8 @@ gdk_win32_display_init_wgl (GdkDisplay *display,
}
}
+ display_win32->wgl_pixel_format = best_idx;
+
display_win32->hasWglARBCreateContext =
epoxy_has_wgl_extension (hdc, "WGL_ARB_create_context");
display_win32->hasWglEXTSwapControl =