summaryrefslogtreecommitdiff
path: root/services
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2015-01-29 16:32:50 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2015-01-29 16:32:50 +0100
commit8584a39fa431c85e0a9dd4c5c1b60d6f23d99f0b (patch)
tree4717cbc0d092197983a5ec14449f3fbbdeaa7081 /services
parentf70e8331c2a6976ad711e13f3796e1350750d2e9 (diff)
PanelService: define periority per parent window
(bzr r3899.2.11)
Diffstat (limited to 'services')
-rw-r--r--services/panel-service.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/services/panel-service.c b/services/panel-service.c
index 1636e0a0e..c8c041f0e 100644
--- a/services/panel-service.c
+++ b/services/panel-service.c
@@ -1647,12 +1647,16 @@ static void
indicator_object_full_to_variant (IndicatorObject *object, const gchar *indicator_id, GVariantBuilder *b)
{
GList *entries, *e;
+ GHashTable *index_hash = NULL;
gint parent_prio = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (object), "priority"));
entries = indicator_object_get_entries (object);
- gint index = 0;
+ guint index = 0;
if (entries)
{
+ if (g_strcmp0 (indicator_id, "libappmenu.so") == 0)
+ index_hash = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL);
+
for (e = entries; e; e = e->next)
{
gint prio = -1;
@@ -1666,14 +1670,29 @@ indicator_object_full_to_variant (IndicatorObject *object, const gchar *indicato
if (prio < 0)
{
+ if (index_hash)
+ {
+ index = GPOINTER_TO_UINT (g_hash_table_lookup (index_hash,
+ GUINT_TO_POINTER (entry->parent_window)));
+ }
+
prio = parent_prio + index;
index++;
+
+ if (index_hash)
+ {
+ g_hash_table_insert (index_hash, GUINT_TO_POINTER (entry->parent_window),
+ GUINT_TO_POINTER (index));
+ }
}
indicator_entry_to_variant (entry, id, indicator_id, b, prio);
g_free (id);
}
+ if (index_hash)
+ g_hash_table_destroy (index_hash);
+
g_list_free (entries);
}
else