summaryrefslogtreecommitdiff
path: root/gdk/gdkglcontextprivate.h
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2021-09-24 01:47:03 +0200
committerBenjamin Otte <otte@redhat.com>2021-09-24 01:59:37 +0200
commit23acc993cced48fa1f21ac9f4881338100b1a15a (patch)
tree50f1708b91e4ec16d532e8631edf501a5d314299 /gdk/gdkglcontextprivate.h
parentd7db3f1546156f406509e5bfbf076cd575c5628d (diff)
downloadgtk+-23acc993cced48fa1f21ac9f4881338100b1a15a.tar.gz
gdk: Make sure only one GL backend is usedwip/otte/shittymorph
Creative people managed to create an X11 display and a Wayland display at once, thereby getting EGL and GLX involved in a fight to the death over the ownership of the glFoo() symbolspace. A way to force such a fight with available tools here is (on Wayland) running something like: GTK_INSPECTOR_DISPLAY=:1 GTK_DEBUG=interactive gtk4-demo Related: xdg-desktop-portal-gnome#5
Diffstat (limited to 'gdk/gdkglcontextprivate.h')
-rw-r--r--gdk/gdkglcontextprivate.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdk/gdkglcontextprivate.h b/gdk/gdkglcontextprivate.h
index c8afedda02..050e757608 100644
--- a/gdk/gdkglcontextprivate.h
+++ b/gdk/gdkglcontextprivate.h
@@ -34,6 +34,14 @@ G_BEGIN_DECLS
#define GDK_EGL_MIN_VERSION_MAJOR (1)
#define GDK_EGL_MIN_VERSION_MINOR (4)
+typedef enum {
+ GDK_GL_NONE = 0,
+ GDK_GL_EGL,
+ GDK_GL_GLX,
+ GDK_GL_WGL,
+ GDK_GL_CGL
+} GdkGLBackend;
+
#define GDK_GL_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GL_CONTEXT, GdkGLContextClass))
#define GDK_IS_GL_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GL_CONTEXT))
#define GDK_GL_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GL_CONTEXT, GdkGLContextClass))
@@ -52,6 +60,8 @@ struct _GdkGLContextClass
{
GdkDrawContextClass parent_class;
+ GdkGLBackend backend_type;
+
gboolean (* realize) (GdkGLContext *context,
GError **error);
@@ -86,6 +96,10 @@ typedef struct {
guint use_es : 1;
} GdkGLContextPaintData;
+gboolean gdk_gl_backend_can_be_used (GdkGLBackend backend_type,
+ GError **error);
+void gdk_gl_backend_use (GdkGLBackend backend_type);
+
GdkGLContext * gdk_gl_context_new_for_surface (GdkSurface *surface);
void gdk_gl_context_set_is_legacy (GdkGLContext *context,