From a2ccb6601e0fb6dbe55517ad399728a00f6d7e40 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Wed, 22 Jan 2014 18:48:45 -0500 Subject: [PATCH] gdk: enable rgba visuals by default Unless GDK_RGBA=0 is set. https://bugzilla.gnome.org/show_bug.cgi?id=630217 --- docs/reference/gtk/running.sgml | 9 +++++++++ gdk/x11/gdkvisual-x11.c | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/docs/reference/gtk/running.sgml b/docs/reference/gtk/running.sgml index 8065e194e8..c7d2d9bc9a 100644 --- a/docs/reference/gtk/running.sgml +++ b/docs/reference/gtk/running.sgml @@ -478,6 +478,15 @@ nevertheless. + + <envar>GDK_RGBA</envar> + + + Since 3.12, this environment variable can be used to prevent + using RGBA visuals on the X11 backend by setting GDK_RGBA=0. + + + <envar>XDG_DATA_HOME</envar>, <envar>XDG_DATA_DIRS</envar> diff --git a/gdk/x11/gdkvisual-x11.c b/gdk/x11/gdkvisual-x11.c index 752beb6bf8..9bbe7e47ea 100644 --- a/gdk/x11/gdkvisual-x11.c +++ b/gdk/x11/gdkvisual-x11.c @@ -285,6 +285,14 @@ _gdk_x11_screen_init_visuals (GdkScreen *screen) } } + /* prefer the RGBA visual unless GDK_RGBA=0 */ + if (x11_screen->rgba_visual) + { + const gchar *csd_env = g_getenv ("GDK_RGBA"); + if (g_strcmp0 (csd_env, "0") != 0) + x11_screen->system_visual = x11_screen->rgba_visual; + } + #ifdef G_ENABLE_DEBUG if (_gdk_debug_flags & GDK_DEBUG_MISC) {