Merge lp:~samuel-thibault/compiz/plugin-load-order into lp:compiz/0.9.13

Proposed by Samuel thibault
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: 4134
Merged at revision: 4135
Proposed branch: lp:~samuel-thibault/compiz/plugin-load-order
Merge into: lp:compiz/0.9.13
Diff against target: 29 lines (+12/-0)
1 file modified
compizconfig/libcompizconfig/src/main.c (+12/-0)
To merge this branch: bzr merge lp:~samuel-thibault/compiz/plugin-load-order
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+333039@code.launchpad.net

Commit message

compizconfig: load modules in alphabetical order instead of undefined order

Description of the change

This makes compiz load plugins in alphabetical order instead of undefined order, which brings variability on the varying systems of users, and thus potential bugs that users will see and developers won't see.

To post a comment you must log in.
Revision history for this message
Samuel thibault (samuel-thibault) wrote :

(of course it lets dependencies fix the ordering, I just mean that independent modules get loaded in alphabetical order).

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Well, the order isn't really undefined, as it has constrains defined by dependencies... If none needs a plugin is true that there's no order, but it shouldn't affect things.

However I think this won't cause any trouble, but at least we can guess better what will happen

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'compizconfig/libcompizconfig/src/main.c'
2--- compizconfig/libcompizconfig/src/main.c 2014-04-07 22:36:52 +0000
3+++ compizconfig/libcompizconfig/src/main.c 2017-10-31 17:27:44 +0000
4@@ -3012,6 +3012,15 @@
5 CCSPluginList after;
6 } PluginSortHelper;
7
8+static int
9+PluginCompare (const void *_a, const void *_b)
10+{
11+ const PluginSortHelper *a = _a;
12+ const PluginSortHelper *b = _b;
13+
14+ return strcmp (ccsPluginGetName (a->plugin), ccsPluginGetName (b->plugin));
15+}
16+
17 CCSStringList
18 ccsGetSortedPluginStringListDefault (CCSContext * context)
19 {
20@@ -3052,6 +3061,9 @@
21 plugins[i].after = NULL;
22 }
23
24+ /* Sort alphabetically first, to get a stable order. */
25+ qsort (plugins, len, sizeof (PluginSortHelper), PluginCompare);
26+
27 for (i = 0; i < len; ++i)
28 {
29 CCSStringList l = ccsPluginGetLoadAfter (plugins[i].plugin);

Subscribers

People subscribed via source and target branches