Description: disable Ubuntu overlay scrollbars to prevent black
background in certain windows
Author: Marc Deslauriers <marc.deslauriers@canonical.com>
Forwarded: https://forum.handbrake.fr/viewtopic.php?f=12&t=30119
Index: handbrake-0.10.0+ppa1/gtk/src/main.c
===================================================================
--- handbrake-0.10.0+ppa1.orig/gtk/src/main.c 2015-01-24 11:02:58.756111796 -0500
+++ handbrake-0.10.0+ppa1/gtk/src/main.c 2015-01-24 11:10:30.187701805 -0500
@@ -646,6 +646,50 @@
g_io_add_watch(channel, G_IO_IN, ghb_log_cb, (gpointer)ud );
}
+// Disable Ubuntu Overlay Scrollbars. They are causing a theming issue
+// that makes the background turn black in certain windows, and they will
+// be replaced soon with overlayed scrollbars in GTK+ 3.16.
+static void
+disable_overlay_scrollbars()
+{
+ GSList *modules_list = NULL;
+ GSList *l = NULL;
+ guint length, n;
+ gchar **modules;
+ const gchar *old;
+
+ if ((old = g_getenv("GTK_MODULES")) != NULL)
+ {
+ modules = g_strsplit(old, ":", -1);
+ for (n = 0; modules[n]; n++)
+ {
+ if (!g_strcmp0 (modules[n], "overlay-scrollbar"))
+ {
+ continue;
+ }
+ modules_list = g_slist_prepend(modules_list, modules[n]);
+ }
+
+ g_free(modules);
+
+ modules_list = g_slist_reverse(modules_list);
+ length = g_slist_length(modules_list);
+
+ modules = g_new(gchar *, length + 1);
+ modules[length--] = NULL;
+
+ for (l = modules_list; l; l = l->next)
+ {
+ modules[length--] = g_strdup(l->data);
+ }
+
+ g_setenv("GTK_MODULES", g_strjoinv (":", modules), TRUE);
+
+ g_strfreev(modules);
+ g_slist_free(modules_list);
+ }
+}
+
typedef struct
{
gchar *filename;
@@ -788,6 +832,7 @@
GError *error = NULL;
GOptionContext *context;
+ disable_overlay_scrollbars();
hb_global_init();
#ifdef ENABLE_NLS