Merge lp:~aacid/overlay-scrollbar/blacklisted_libs into lp:overlay-scrollbar

Proposed by Albert Astals Cid on 2012-09-18
Status: Rejected
Rejected by: Albert Astals Cid on 2012-10-01
Proposed branch: lp:~aacid/overlay-scrollbar/blacklisted_libs
Merge into: lp:overlay-scrollbar
Diff against target: 47 lines (+25/-1)
1 file modified
os/os-scrollbar.c (+25/-1)
To merge this branch: bzr merge lp:~aacid/overlay-scrollbar/blacklisted_libs
Reviewer Review Type Date Requested Status
jenkins (community) continuous-integration Approve on 2012-09-18
Ayatana Scrollbar Team 2012-09-18 Pending
Review via email: mp+124873@code.launchpad.net

Commit message

Look at /proc/pid/maps for blacklisted libs

Description of the change

Look at /proc/pid/maps for blacklisted libs

To post a comment you must log in.
Albert Astals Cid (aacid) wrote :

FWIW I'm going on holiday tomorrow, will be back October 1st

Albert Astals Cid (aacid) wrote :

Rejecting the branch, https://code.launchpad.net/~aacid/ayatana-scrollbar/qt_no_overlay_scrollbar/+merge/124697 has been merged into the distro package fixing the crashes and this one is just another big hack and has had no comments for a week so i guess Andrea is not interested in it either

Unmerged revisions

357. By Albert Astals Cid on 2012-09-18

Look at /proc/pid/maps for blacklisted libs

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'os/os-scrollbar.c'
2--- os/os-scrollbar.c 2012-08-29 16:09:23 +0000
3+++ os/os-scrollbar.c 2012-09-18 09:51:39 +0000
4@@ -3158,10 +3158,29 @@
5 }
6 }
7
8+static gboolean searched_libs = FALSE;
9+static gboolean searched_libs_blacklisted = FALSE;
10+
11 static gboolean
12 use_overlay_scrollbar (void)
13 {
14- return scrollbar_mode != SCROLLBAR_MODE_NORMAL;
15+ if (!searched_libs)
16+ {
17+#ifndef GTK3
18+ gchar proc_path[20];
19+ pid_t pid = getpid ();
20+ sprintf (proc_path, "/proc/%d/maps", pid);
21+ gchar *contents;
22+ if (g_file_get_contents (proc_path, &contents, NULL, NULL))
23+ {
24+ if (g_strrstr (contents, "/libQtGui.so"))
25+ searched_libs_blacklisted = TRUE;
26+ }
27+ g_free(contents);
28+#endif
29+ searched_libs = TRUE;
30+ }
31+ return !searched_libs_blacklisted && scrollbar_mode != SCROLLBAR_MODE_NORMAL;
32 }
33
34 static void
35@@ -4231,7 +4250,12 @@
36 "}\n", -1, NULL);
37 #endif
38
39+ // don't want to trigger the libs search yet,
40+ // we want to do it when someone creates a scrollbar,
41+ // i.e. the next time use_overlay_scrollbar () is called
42+ searched_libs = TRUE;
43 /* Load custom overlay scrollbar style. */
44 if (use_overlay_scrollbar ())
45 custom_style_load ();
46+ searched_libs = FALSE;
47 }

Subscribers

People subscribed via source and target branches