diff options
author | Benjamin Otte <otte@redhat.com> | 2023-02-02 02:49:56 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2023-02-02 04:23:51 +0100 |
commit | c6cef6db526930b4cd925c0998da5acc4d4ab35d (patch) | |
tree | cd6094b7b2f57a3a9069f4fd765ffc4c47ea0bb1 /gdk/gdkglcontextprivate.h | |
parent | fdea27c04d0a10e8b79bb4fd484788f6853a6f6a (diff) | |
download | gtk+-c6cef6db526930b4cd925c0998da5acc4d4ab35d.tar.gz |
gdk: Add private GLContext::is_current() check
... and use this check in gdk_gl_context_make_current() and
gdk_gl_context_get_current() to make sure the context really is still
current.
The context no longer being current can happen when external GL
implementations make their own contexts current in the same threads GDK
contexts are used in.
And that can happen for example by WebKit.
Theoretically, this should also allow external EGL code to run in X11
applications when GDK chooses to use GLX, but I didn't try it.
Fixes #5392
Diffstat (limited to 'gdk/gdkglcontextprivate.h')
-rw-r--r-- | gdk/gdkglcontextprivate.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gdk/gdkglcontextprivate.h b/gdk/gdkglcontextprivate.h index bd66172eba..2ed799d6f7 100644 --- a/gdk/gdkglcontextprivate.h +++ b/gdk/gdkglcontextprivate.h @@ -83,6 +83,7 @@ struct _GdkGLContextClass gboolean (* make_current) (GdkGLContext *context, gboolean surfaceless); gboolean (* clear_current) (GdkGLContext *context); + gboolean (* is_current) (GdkGLContext *context); cairo_region_t * (* get_damage) (GdkGLContext *context); gboolean (* is_shared) (GdkGLContext *self, |