diff -Nru gtk+3.0-3.20.9/debian/changelog gtk+3.0-3.20.9/debian/changelog --- gtk+3.0-3.20.9/debian/changelog 2016-09-09 10:24:36.000000000 +0200 +++ gtk+3.0-3.20.9/debian/changelog 2017-02-08 16:53:03.000000000 +0100 @@ -1,3 +1,12 @@ +gtk+3.0 (3.20.9-1ubuntu2.1) yakkety; urgency=medium + + * d/p/gdk-x11-Check-if-we-have-access-to-GL-before-using-G.patch: + add proposed patch from upstream Bugzilla to let GDK X11 + initialization complete successfully when libGL.so.1 is not + available (Closes: #847366, LP: #1550983) + + -- Dariusz Gadomski Wed, 08 Feb 2017 16:53:03 +0100 + gtk+3.0 (3.20.9-1ubuntu2) yakkety; urgency=medium * Add 0002-Fix-other-locations-with-glib-249.patch and diff -Nru gtk+3.0-3.20.9/debian/patches/gdk-x11-Check-if-we-have-access-to-GL-before-using-G.patch gtk+3.0-3.20.9/debian/patches/gdk-x11-Check-if-we-have-access-to-GL-before-using-G.patch --- gtk+3.0-3.20.9/debian/patches/gdk-x11-Check-if-we-have-access-to-GL-before-using-G.patch 1970-01-01 01:00:00.000000000 +0100 +++ gtk+3.0-3.20.9/debian/patches/gdk-x11-Check-if-we-have-access-to-GL-before-using-G.patch 2017-02-08 16:53:03.000000000 +0100 @@ -0,0 +1,51 @@ +From 1fb5f0aed9976437d8c9c82071efe9a447d73de1 Mon Sep 17 00:00:00 2001 +From: Emmanuele Bassi +Date: Fri, 20 Jan 2017 18:07:01 +0000 +Subject: [PATCH] gdk/x11: Check if we have access to GL before using GLX API + +If the platform does not have access to libGL then any call to GL and +GLX API through libepoxy will fail with an assertion. Until such time +that libepoxy exposes API for us to use, we can simply dlopen libGL +ourselves and do a symbol check. + +[smcv: fix typo] + +Bug: https://bugzilla.gnome.org/show_bug.cgi?id=775279 +Bug-Debian: https://bugs.debian.org/847366 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1550983 + +--- gtk+3.0-3.20.9.orig/gdk/x11/gdkglcontext-x11.c ++++ gtk+3.0-3.20.9/gdk/x11/gdkglcontext-x11.c +@@ -838,6 +838,32 @@ gdk_x11_screen_init_gl (GdkScreen *scree + if (_gdk_gl_flags & GDK_GL_DISABLE) + return FALSE; + ++ /* This is an ad hoc check that bypasses libepoxy to check if libGL.so is ++ * unavailable, and disables GL support if that's the case ++ * ++ * Ideally, libepoxy should do this for us, but that would require adding ++ * new API, and we'd need a fallback anyway. ++ */ ++ { ++ Bool (* fp_glXQueryExtension) (Display *dpy, int *err_base, int *ev_base); ++ GModule *module = g_module_open ("libGL.so.1", 0); ++ ++ if (module == NULL) ++ { ++ GDK_NOTE (OPENGL, g_message ("No libGL.so found")); ++ return FALSE; ++ } ++ ++ if (!g_module_symbol (module, "glXQueryExtension", (gpointer *) &fp_glXQueryExtension)) ++ { ++ GDK_NOTE (OPENGL, g_message ("No glXQueryExtension symbol found")); ++ g_module_close (module); ++ return FALSE; ++ } ++ ++ g_module_close (module); ++ } ++ + dpy = gdk_x11_display_get_xdisplay (display); + + if (!glXQueryExtension (dpy, &error_base, &event_base)) diff -Nru gtk+3.0-3.20.9/debian/patches/series gtk+3.0-3.20.9/debian/patches/series --- gtk+3.0-3.20.9/debian/patches/series 2016-09-09 10:24:36.000000000 +0200 +++ gtk+3.0-3.20.9/debian/patches/series 2017-02-08 16:53:03.000000000 +0100 @@ -30,3 +30,4 @@ 0001-Update-the-GDK-Mir-backend-to-fix-a-few-problems.patch 0002-fix-other-locations-with-glib-249.patch 0003-use-null-for-generic-marshallers.patch +gdk-x11-Check-if-we-have-access-to-GL-before-using-G.patch