all repos — openbox @ d56e90fac8e821f3773372e9342d60de169963b9

openbox fork - make it a bit more like ryudo

use g_hash_table properly
Dana Jansens danakj@orodu.net
commit

d56e90fac8e821f3773372e9342d60de169963b9

parent

3443454f33f88e10f187b78594ecfb5c09e1448d

3 files changed, 31 insertions(+), 31 deletions(-)

jump to
M engines/openbox/openbox.cengines/openbox/openbox.c

@@ -570,18 +570,18 @@

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 @@ client->area.y);

} /* 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); }
M openbox/client.copenbox/client.c

@@ -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 @@ grab_server(FALSE);

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 @@ engine_frame_hide(client->frame);

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 @@

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*/) {
M openbox/event.copenbox/event.c

@@ -253,7 +253,7 @@ if (e->xcrossing.mode != NotifyNormal) return;

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)