Ubuntu Pastebin

Paste from md at Wed, 18 Feb 2015 19:45:36 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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
Download as text