Merge lp:~larsu/unity/call-ido-init into lp:unity

Proposed by Lars Karlitski
Status: Superseded
Proposed branch: lp:~larsu/unity/call-ido-init
Merge into: lp:unity
Diff against target: 163 lines (+25/-58)
4 files modified
debian/control (+2/-2)
services/CMakeLists.txt (+2/-1)
services/panel-main.c (+2/-0)
services/panel-service.c (+19/-55)
To merge this branch: bzr merge lp:~larsu/unity/call-ido-init
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+172126@code.launchpad.net

This proposal has been superseded by a proposal from 2013-06-28.

Description of the change

unity-panel-service: call ido_init() and honor indicator's position requests.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2013-06-27 18:16:29 +0000
3+++ debian/control 2013-06-28 18:39:32 +0000
4@@ -23,8 +23,8 @@
5 libcairo2-dev,
6 libpango1.0-dev,
7 libdee-dev (>= 1.0.0),
8- libindicator-dev (>= 0.4.90),
9- libindicator3-dev (>= 0.4.90),
10+ libindicator-dev (>= 0.12.2),
11+ libindicator3-dev (>= 0.12.2),
12 libunity-misc-dev (>= 4.0.4),
13 libgrail-dev (>= 1.0.20),
14 libxcb-icccm4-dev,
15
16=== modified file 'services/CMakeLists.txt'
17--- services/CMakeLists.txt 2013-06-17 11:16:12 +0000
18+++ services/CMakeLists.txt 2013-06-28 18:39:32 +0000
19@@ -9,8 +9,9 @@
20 gobject-2.0
21 gthread-2.0
22 gtk+-3.0>=3.3
23- indicator3-0.4>=0.4.90
24+ indicator3-0.4>=12.10.2
25 x11
26+ libido3-0.1>=13.0.0
27 )
28
29 pkg_check_modules(SERVICE_DEPS REQUIRED ${UNITY_PANEL_SERVICE_DEPS})
30
31=== modified file 'services/panel-main.c'
32--- services/panel-main.c 2012-12-05 14:52:45 +0000
33+++ services/panel-main.c 2013-06-28 18:39:32 +0000
34@@ -21,6 +21,7 @@
35 #include <glib.h>
36 #include <gio/gio.h>
37 #include <gtk/gtk.h>
38+#include <libido/libido.h>
39
40 #include "config.h"
41 #include "panel-a11y.h"
42@@ -388,6 +389,7 @@
43 gtk_init (&argc, &argv);
44 gtk_icon_theme_append_search_path (gtk_icon_theme_get_default(),
45 INDICATORICONDIR);
46+ ido_init ();
47
48 if (g_getenv ("SILENT_PANEL_SERVICE") != NULL)
49 {
50
51=== modified file 'services/panel-service.c'
52--- services/panel-service.c 2013-04-23 20:44:20 +0000
53+++ services/panel-service.c 2013-06-28 18:39:32 +0000
54@@ -1113,48 +1113,29 @@
55 return -1;
56 }
57
58-static gint
59-name2priority (const gchar * name, const gchar * hint)
60-{
61- gint order = name2order (name, hint);
62- if (order > -1)
63- return order * MAX_INDICATOR_ENTRIES;
64-
65- return order;
66-}
67-
68-static int
69-indicator_compare_func (IndicatorObject *o1, IndicatorObject *o2)
70-{
71- gchar *s1;
72- gchar *s2;
73- int i1;
74- int i2;
75-
76- s1 = g_object_get_data (G_OBJECT (o1), "id");
77- s2 = g_object_get_data (G_OBJECT (o2), "id");
78-
79- i1 = name2order (s1, NULL);
80- i2 = name2order (s2, NULL);
81-
82- return i1 - i2;
83-}
84-
85 static void
86 sort_indicators (PanelService *self)
87 {
88 GSList *i;
89 int k = 0;
90- int prio = 0;
91-
92- self->priv->indicators = g_slist_sort (self->priv->indicators,
93- (GCompareFunc)indicator_compare_func);
94
95 for (i = self->priv->indicators; i; i = i->next)
96 {
97- prio = name2priority(g_object_get_data (G_OBJECT (i->data), "id"), NULL);
98- if (prio < 0) continue;
99- g_object_set_data (G_OBJECT (i->data), "priority", GINT_TO_POINTER (prio));
100+ IndicatorObject *io = i->data;
101+ gint pos;
102+
103+ pos = indicator_object_get_position (io);
104+
105+ /* Continue using the state ordering as long as there are still
106+ * plugins statically defined in this file. Give them a much
107+ * higher position though, so that they appear to the right of the
108+ * indicators that return a proper position */
109+ if (pos < 0)
110+ pos = 1000 - name2order (g_object_get_data (G_OBJECT (io), "id"), NULL);
111+
112+ /* unity's concept of priorities is inverse to ours right now */
113+ g_object_set_data (G_OBJECT (i->data), "priority", GINT_TO_POINTER (1000 - pos));
114+
115 g_object_set_data (G_OBJECT (i->data), "position", GINT_TO_POINTER (k));
116 self->priv->timeouts[k] = SYNC_NEUTRAL;
117 k++;
118@@ -1277,16 +1258,8 @@
119 IndicatorObjectEntry *entry = e->data;
120 gchar *id = get_indicator_entry_id_by_entry (entry);
121
122- if (entry->name_hint)
123- {
124- prio = name2priority(indicator_id, entry->name_hint);
125- }
126-
127- if (prio == -1)
128- {
129- prio = parent_prio + index;
130- index++;
131- }
132+ prio = parent_prio + index;
133+ index++;
134
135 indicator_entry_to_variant (entry, id, indicator_id, b, prio);
136 g_free (id);
137@@ -1583,7 +1556,6 @@
138
139 for (l = indicators; l; l = l->next)
140 {
141- const gchar *indicator_id = g_object_get_data (G_OBJECT (l->data), "id");
142 gint parent_priority = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (l->data), "priority"));
143 entries = indicator_object_get_entries (l->data);
144 if (entries)
145@@ -1598,16 +1570,8 @@
146 if (!panel_service_entry_is_visible (self, new_entry))
147 continue;
148
149- if (new_entry->name_hint)
150- {
151- prio = name2priority(indicator_id, new_entry->name_hint);
152- }
153-
154- if (prio == -1)
155- {
156- prio = parent_priority + index;
157- index++;
158- }
159+ prio = parent_priority + index;
160+ index++;
161
162 gpointer *values = g_new (gpointer, 2);
163 values[0] = new_entry;