use g_hash_table properly
This commit is contained in:
parent
3443454f33
commit
d56e90fac8
3 changed files with 31 additions and 31 deletions
|
@ -570,18 +570,18 @@ void frame_grab_client(ObFrame *self, Client *client)
|
|||
frame_adjust_area(self, TRUE, TRUE);
|
||||
|
||||
/* set all the windows for the frame in the client_map */
|
||||
g_hash_table_insert(client_map, (gpointer)self->frame.window, client);
|
||||
g_hash_table_insert(client_map, (gpointer)self->frame.plate, client);
|
||||
g_hash_table_insert(client_map, (gpointer)self->title, client);
|
||||
g_hash_table_insert(client_map, (gpointer)self->label, client);
|
||||
g_hash_table_insert(client_map, (gpointer)self->max, client);
|
||||
g_hash_table_insert(client_map, (gpointer)self->close, client);
|
||||
g_hash_table_insert(client_map, (gpointer)self->desk, client);
|
||||
g_hash_table_insert(client_map, (gpointer)self->icon, client);
|
||||
g_hash_table_insert(client_map, (gpointer)self->iconify, client);
|
||||
g_hash_table_insert(client_map, (gpointer)self->handle, client);
|
||||
g_hash_table_insert(client_map, (gpointer)self->lgrip, client);
|
||||
g_hash_table_insert(client_map, (gpointer)self->rgrip, client);
|
||||
g_hash_table_insert(client_map, &self->frame.window, client);
|
||||
g_hash_table_insert(client_map, &self->frame.plate, client);
|
||||
g_hash_table_insert(client_map, &self->title, client);
|
||||
g_hash_table_insert(client_map, &self->label, client);
|
||||
g_hash_table_insert(client_map, &self->max, client);
|
||||
g_hash_table_insert(client_map, &self->close, client);
|
||||
g_hash_table_insert(client_map, &self->desk, client);
|
||||
g_hash_table_insert(client_map, &self->icon, client);
|
||||
g_hash_table_insert(client_map, &self->iconify, client);
|
||||
g_hash_table_insert(client_map, &self->handle, client);
|
||||
g_hash_table_insert(client_map, &self->lgrip, client);
|
||||
g_hash_table_insert(client_map, &self->rgrip, client);
|
||||
}
|
||||
|
||||
void frame_release_client(ObFrame *self, Client *client)
|
||||
|
@ -605,18 +605,18 @@ void frame_release_client(ObFrame *self, Client *client)
|
|||
}
|
||||
|
||||
/* remove all the windows for the frame from the client_map */
|
||||
g_hash_table_remove(client_map, (gpointer)self->frame.window);
|
||||
g_hash_table_remove(client_map, (gpointer)self->frame.plate);
|
||||
g_hash_table_remove(client_map, (gpointer)self->title);
|
||||
g_hash_table_remove(client_map, (gpointer)self->label);
|
||||
g_hash_table_remove(client_map, (gpointer)self->max);
|
||||
g_hash_table_remove(client_map, (gpointer)self->close);
|
||||
g_hash_table_remove(client_map, (gpointer)self->desk);
|
||||
g_hash_table_remove(client_map, (gpointer)self->icon);
|
||||
g_hash_table_remove(client_map, (gpointer)self->iconify);
|
||||
g_hash_table_remove(client_map, (gpointer)self->handle);
|
||||
g_hash_table_remove(client_map, (gpointer)self->lgrip);
|
||||
g_hash_table_remove(client_map, (gpointer)self->rgrip);
|
||||
g_hash_table_remove(client_map, &self->frame.window);
|
||||
g_hash_table_remove(client_map, &self->frame.plate);
|
||||
g_hash_table_remove(client_map, &self->title);
|
||||
g_hash_table_remove(client_map, &self->label);
|
||||
g_hash_table_remove(client_map, &self->max);
|
||||
g_hash_table_remove(client_map, &self->close);
|
||||
g_hash_table_remove(client_map, &self->desk);
|
||||
g_hash_table_remove(client_map, &self->icon);
|
||||
g_hash_table_remove(client_map, &self->iconify);
|
||||
g_hash_table_remove(client_map, &self->handle);
|
||||
g_hash_table_remove(client_map, &self->lgrip);
|
||||
g_hash_table_remove(client_map, &self->rgrip);
|
||||
|
||||
frame_free(self);
|
||||
}
|
||||
|
|
|
@ -38,8 +38,8 @@ static Client *search_focus_tree(Client *node, Client *skip);
|
|||
static void client_apply_startup_state(Client *self);
|
||||
static Client *search_modal_tree(Client *node, Client *skip);
|
||||
|
||||
static guint map_hash(Window w) { return w; }
|
||||
static gboolean map_key_comp(Window w1, Window w2) { return w1 == w2; }
|
||||
static guint map_hash(Window *w) { return *w; }
|
||||
static gboolean map_key_comp(Window *w1, Window *w2) { return *w1 == *w2; }
|
||||
|
||||
void client_startup()
|
||||
{
|
||||
|
@ -186,8 +186,8 @@ void client_manage(Window window)
|
|||
|
||||
client_list = g_slist_append(client_list, client);
|
||||
stacking_list = g_list_append(stacking_list, client);
|
||||
g_assert(!g_hash_table_lookup(client_map, (gpointer)client->window));
|
||||
g_hash_table_insert(client_map, (gpointer)window, client);
|
||||
g_assert(!g_hash_table_lookup(client_map, &client->window));
|
||||
g_hash_table_insert(client_map, &client->window, client);
|
||||
|
||||
/* update the focus lists */
|
||||
if (client->desktop == DESKTOP_ALL) {
|
||||
|
@ -241,7 +241,7 @@ void client_unmanage(Client *client)
|
|||
|
||||
client_list = g_slist_remove(client_list, client);
|
||||
stacking_list = g_list_remove(stacking_list, client);
|
||||
g_hash_table_remove(client_map, (gpointer)client->window);
|
||||
g_hash_table_remove(client_map, &client->window);
|
||||
|
||||
/* update the focus lists */
|
||||
if (client->desktop == DESKTOP_ALL) {
|
||||
|
@ -528,7 +528,7 @@ void client_update_transient_for(Client *self)
|
|||
if (XGetTransientForHint(ob_display, self->window, &t) &&
|
||||
t != self->window) { /* cant be transient to itself! */
|
||||
self->transient = TRUE;
|
||||
c = g_hash_table_lookup(client_map, (gpointer)t);
|
||||
c = g_hash_table_lookup(client_map, &t);
|
||||
g_assert(c != self);/* if this happens then we need to check for it*/
|
||||
|
||||
if (!c /*XXX: && _group*/) {
|
||||
|
|
|
@ -253,7 +253,7 @@ void event_process(XEvent *e)
|
|||
break;
|
||||
}
|
||||
|
||||
client = g_hash_table_lookup(client_map, (gpointer)window);
|
||||
client = g_hash_table_lookup(client_map, &window);
|
||||
|
||||
/* deal with it in the kernel */
|
||||
if (client)
|
||||
|
|
Loading…
Reference in a new issue