Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | From 23a563155406980dfc8cf6f7c2da6cce0ac310f0 Mon Sep 17 00:00:00 2001 |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 2 | From: Jussi Kukkonen <jussi.kukkonen@intel.com> |
| 3 | Date: Fri, 16 Oct 2015 16:35:16 +0300 |
| 4 | Subject: [PATCH 2/4] Do not try to initialize GL without libGL |
| 5 | |
| 6 | _gdk_x11_screen_update_visuals_for_gl() will end up calling epoxys |
| 7 | GLX api which will exit() if libGL.so.1 is not present. We do not |
| 8 | want that to happen and we don't want every app to have to set |
| 9 | "GDK_GL=disabled" environment variable: so use #ifdef set based on |
| 10 | opengl distro feature. |
| 11 | |
| 12 | Upstream is not interested in the fix as it is: Either epoxy should be |
| 13 | fixed (to not exit) or GTK+ possibly could do some additional probing |
| 14 | before calling epoxy APIs. |
| 15 | |
| 16 | Upstream-Status: Denied |
| 17 | Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 18 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 19 | --- |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 20 | configure.ac | 6 ++++++ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 21 | gdk/x11/gdkvisual-x11.c | 5 +++++ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 22 | 2 files changed, 11 insertions(+) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 23 | |
| 24 | diff --git a/configure.ac b/configure.ac |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 25 | index 757fd7c..0a48875 100644 |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 26 | --- a/configure.ac |
| 27 | +++ b/configure.ac |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 28 | @@ -351,6 +351,12 @@ AC_ARG_ENABLE(cloudproviders, |
| 29 | [AS_HELP_STRING([--enable-cloudproviders], |
| 30 | [enable libcloudproviders integration])], |
| 31 | [cloudproviders_set=yes]) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 32 | +AC_ARG_ENABLE(glx, |
| 33 | + [AS_HELP_STRING([--enable-glx], |
| 34 | + [When enabled Gdk will try to initialize GLX])]) |
| 35 | +AS_IF([test "x$enable_glx" != "xno"], [ |
| 36 | + AC_DEFINE([HAVE_GLX], [], [GLX will be available at runtime]) |
| 37 | +]) |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 38 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 39 | if test -z "$backend_set"; then |
| 40 | if test "$platform_win32" = yes; then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 41 | diff --git a/gdk/x11/gdkvisual-x11.c b/gdk/x11/gdkvisual-x11.c |
| 42 | index 81479d8..3c8c5c0 100644 |
| 43 | --- a/gdk/x11/gdkvisual-x11.c |
| 44 | +++ b/gdk/x11/gdkvisual-x11.c |
| 45 | @@ -306,7 +306,12 @@ _gdk_x11_screen_init_visuals (GdkScreen *screen) |
| 46 | /* If GL is available we want to pick better default/rgba visuals, |
| 47 | as we care about glx details such as alpha/depth/stencil depth, |
| 48 | stereo and double buffering */ |
| 49 | + /* update_visuals_for_gl() will end up calling epoxy GLX api which |
| 50 | + will exit if libgl is not there: so only do this if we know GL |
| 51 | + is available */ |
| 52 | +#ifdef HAVE_GLX |
| 53 | _gdk_x11_screen_update_visuals_for_gl (screen); |
| 54 | +#endif |
| 55 | } |
| 56 | |
| 57 | gint |
| 58 | -- |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 59 | 2.14.1 |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 60 | |