X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=openbox%2Fclient.c;h=ade1a1093cb59abf9fea2a7acf79d2c311179086;hb=a373b1582e4e40a4f126632a7528553e74fd26f2;hp=75a3bc251c729b214c4021df5ad9e6770d3e81ef;hpb=5a7953b36aa0e23ae21f707d9fb8b6b9e882946d;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 75a3bc25..ade1a109 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -14,6 +14,7 @@ #include "openbox.h" #include "group.h" #include "config.h" +#include "menu.h" #include "render/render.h" #include @@ -311,6 +312,13 @@ void client_unmanage_all() client_unmanage(client_list->data); } +/* called by client_unmanage() to close any menus referencing this client */ +void client_close_menus(gpointer key, gpointer value, gpointer self) +{ + if (((Menu *)value)->client == (Client *)self) + menu_hide((Menu *)value); +} + void client_unmanage(Client *self) { int j; @@ -364,6 +372,10 @@ void client_unmanage(Client *self) if (moveresize_client == self) moveresize_end(TRUE); + /* close any windows that are attached to this window */ + g_hash_table_foreach(menu_hash, client_close_menus, self); + + if (focus_client == self) { XEvent e; @@ -2013,7 +2025,7 @@ void client_set_desktop(Client *self, guint target, gboolean donthide) if (target == self->desktop) return; - g_message("Setting desktop %u", target); + g_message("Setting desktop %u", target+1); g_assert(target < screen_num_desktops || target == DESKTOP_ALL); @@ -2205,7 +2217,7 @@ void client_set_state(Client *self, Atom action, long data1, long data2) if (shaded != self->shaded) client_shade(self, shaded); client_calc_layer(self); - client_change_state(self); /* change the hint to relect these changes */ + client_change_state(self); /* change the hint to reflect these changes */ } Client *client_focus_target(Client *self) @@ -2439,3 +2451,18 @@ Client *client_find_directional(Client *c, Direction dir) return best_client; } + +void client_set_layer(Client *self, int layer) +{ + if (layer < 0) { + self->below = TRUE; + self->above = FALSE; + } else if (layer == 0) { + self->below = self->above = FALSE; + } else { + self->below = FALSE; + self->above = TRUE; + } + client_calc_layer(self); + client_change_state(self); /* reflect this in the state hints */ +}