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; }
9 void group_startup(gboolean reconfig)
13 group_map = g_hash_table_new((GHashFunc)map_hash,
14 (GEqualFunc)map_key_comp);
17 void group_shutdown(gboolean reconfig)
21 g_hash_table_destroy(group_map);
24 ObGroup *group_add(Window leader, ObClient *client)
28 self = g_hash_table_lookup(group_map, &leader);
30 self = g_new(ObGroup, 1);
31 self->leader = leader;
33 g_hash_table_insert(group_map, &self->leader, self);
36 self->members = g_slist_append(self->members, client);
41 void group_remove(ObGroup *self, ObClient *client)
43 self->members = g_slist_remove(self->members, client);
44 if (self->members == NULL) {
45 g_hash_table_remove(group_map, &self->leader);