summaryrefslogtreecommitdiff
path: root/gdk/win32/gdkdisplay-win32.h
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2017-10-30 15:00:28 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2017-11-04 10:39:03 +0800
commit322814989280441c25fc654dba4b7ac427fdfb57 (patch)
treec45169cccc6f4b7d9054e61ff8eeeaec4149bfd2 /gdk/win32/gdkdisplay-win32.h
parent6a12a3cd10c9985d2dbbf176e6899b54880e14dd (diff)
downloadgtk+-322814989280441c25fc654dba4b7ac427fdfb57.tar.gz
gdk/win32: Fix Win32 GL Context switching
Since on Windows we need to use a good amount of temporary GL contexts, we need to switch back to the original GL contexts we were using when we are done with the temporary GL contexts, otherwise multi-GL windows will cause confusions causing display artifacts and crashes. Also, use the GdkWin32GLContext::gl_hdc consistently throughout the code and remove the GdkWin32Display::gl_hdc as Lukas K pointed out that GdkWin32Display::gl_hdc becomes out-of-date and so the HDC that the GL context is bound to becomes incorrect in sceanarios using multiple windows with GtkGLArea/GdkGLArea items (which would cause the artifacts in programs that use multiple windows with GtkGLArea/GdkGLArea items, and it turns out that GdkWin32Display::gl_hdc is actually not necessary to help keep track of the HDCs we use for our GL contexts. This will also fix on Windows with GDK_GL=always, or when GSK's gl renderer is used. Partly based on patch from Lukas K <lu@0x83.eu> https://bugzilla.gnome.org/show_bug.cgi?id=789213
Diffstat (limited to 'gdk/win32/gdkdisplay-win32.h')
-rw-r--r--gdk/win32/gdkdisplay-win32.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/gdk/win32/gdkdisplay-win32.h b/gdk/win32/gdkdisplay-win32.h
index c468a0e8e3..9d7a18dd52 100644
--- a/gdk/win32/gdkdisplay-win32.h
+++ b/gdk/win32/gdkdisplay-win32.h
@@ -72,7 +72,6 @@ struct _GdkWin32Display
/* WGL/OpenGL Items */
guint have_wgl : 1;
guint gl_version;
- HDC gl_hdc;
HWND gl_hwnd;
GPtrArray *monitors;