]>
Dogcows Code - chaz/openbox/blob - openbox/group.c
0a03aeefb8124f5b8b0525419499739e437d7334
4 GHashTable
*group_map
= NULL
;
6 static guint
map_hash(Window
*w
) { return *w
; }
7 static gboolean
map_key_comp(Window
*w1
, Window
*w2
) { return *w1
== *w2
; }
11 group_map
= g_hash_table_new((GHashFunc
)map_hash
,
12 (GEqualFunc
)map_key_comp
);
17 g_hash_table_destroy(group_map
);
20 Group
*group_add(Window leader
, ObClient
*client
)
24 self
= g_hash_table_lookup(group_map
, &leader
);
26 self
= g_new(Group
, 1);
27 self
->leader
= leader
;
29 g_hash_table_insert(group_map
, &self
->leader
, self
);
32 self
->members
= g_slist_append(self
->members
, client
);
37 void group_remove(Group
*self
, ObClient
*client
)
39 self
->members
= g_slist_remove(self
->members
, client
);
40 if (self
->members
== NULL
) {
41 g_hash_table_remove(group_map
, &self
->leader
);
This page took 0.035247 seconds and 4 git commands to generate.