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 ObGroup *group_add(Window leader, ObClient *client)
24 self = g_hash_table_lookup(group_map, &leader);
26 self = g_new(ObGroup, 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(ObGroup *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);