X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=9986015c29d9ac3a35bd824552717bc8d6a5f67c;hb=46cf95d36b29cd6bda18ba2d511be10b8e9471cc;hp=281883b14b8a6ed288cd2b172a915364be31d030;hpb=2f0e73cf9d20154c5c84b6ea90e658cf44a6f0c4;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 281883b1..9986015c 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -274,7 +274,7 @@ void client_manage(Window window) /* create the ObClient struct, and populate it from the hints on the window */ self = g_new0(ObClient, 1); - self->obwin.type = Window_Client; + self->obwin.type = OB_WINDOW_CLASS_CLIENT; self->window = window; /* non-zero defaults */ @@ -597,7 +597,7 @@ void client_manage(Window window) /* add to client list/map */ client_list = g_list_append(client_list, self); - g_hash_table_insert(window_map, &self->window, self); + window_add(&self->window, CLIENT_AS_WINDOW(self)); /* this has to happen after we're in the client_list */ if (STRUT_EXISTS(self->strut)) @@ -705,7 +705,7 @@ void client_unmanage(ObClient *self) client_list = g_list_remove(client_list, self); stacking_remove(self); - g_hash_table_remove(window_map, &self->window); + window_remove(self->window); /* once the client is out of the list, update the struts to remove its influence */ @@ -783,8 +783,8 @@ void client_unmanage(ObClient *self) /* these should not be left on the window ever. other window managers don't necessarily use them and it will mess them up (like compiz) */ - PROP_ERASE(self->window, net_wm_visible_name); - PROP_ERASE(self->window, net_wm_visible_icon_name); + OBT_PROP_ERASE(self->window, NET_WM_VISIBLE_NAME); + OBT_PROP_ERASE(self->window, NET_WM_VISIBLE_ICON_NAME); /* update the list hints */ client_set_list(); @@ -1285,13 +1285,13 @@ void client_update_transient_for(ObClient *self) if (XGetTransientForHint(obt_display, self->window, &t)) { if (t != self->window) { /* cant be transient to itself! */ - target = g_hash_table_lookup(window_map, &t); + ObWindow *tw = window_find(t); /* if this happens then we need to check for it*/ - g_assert(target != self); - if (target && !WINDOW_IS_CLIENT(target)) { - /* this can happen when a dialog is a child of - a dockapp, for example */ - target = NULL; + g_assert(tw != CLIENT_AS_WINDOW(self)); + if (target && WINDOW_IS_CLIENT(tw)) { + /* watch out for windows with a parent that is something + different, like a dockapp for example */ + target = WINDOW_AS_CLIENT(tw); } } @@ -1528,7 +1528,7 @@ void client_update_protocols(ObClient *self) /* if this protocol is requested, then the window will be notified whenever we want it to receive focus */ self->focus_notify = TRUE; - else if (proto[i] == prop_atoms.net_wm_ping) + else if (proto[i] == OBT_PROP_ATOM(NET_WM_PING)) /* if this protocol is requested, then the window will allow pings to determine if it is still alive */ self->ping = TRUE; @@ -2282,7 +2282,7 @@ static void client_get_session_ids(ObClient *self) /* see if it has the PID set too (the PID requires that the WM_CLIENT_MACHINE be set) */ - if (PROP_GET32(self->window, net_wm_pid, cardinal, &pid)) + if (OBT_PROP_GET32(self->window, NET_WM_PID, CARDINAL, &pid)) self->pid = pid; } } @@ -3240,8 +3240,8 @@ void client_close(ObClient *self) else /* request the client to close with WM_DELETE_WINDOW */ OBT_PROP_MSG_TO(self->window, self->window, WM_PROTOCOLS, - OBT_PROP_ATOM(WM_DELETE_WINDOW), event_curtime, 0, 0, - NoEventMask); + OBT_PROP_ATOM(WM_DELETE_WINDOW), event_curtime, + 0, 0, 0, NoEventMask); } void client_kill(ObClient *self)