X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=1df411e2090fae1c3a5303d2f1f1236b30ff0bac;hb=d447dc0f59619d26073699d9f81d7de77c200be4;hp=eddd96c427dc1de5cc08381133ce82aa26071790;hpb=0fcd4c30ccd9a857d3ed643abf0c3463d1d5c8d7;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index eddd96c4..1df411e2 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -132,7 +132,6 @@ void client_manage_all() w = client_startup_stack_order[i-1]; c = g_hash_table_lookup(client_map, &w); - g_message("0x%lx %d %d", c->window, c->iconic, c->shaded); if (c) stacking_lower(c); } g_free(client_startup_stack_order); @@ -747,7 +746,8 @@ void client_setup_decor_and_functions(Client *self) { /* start with everything (cept fullscreen) */ self->decorations = Decor_Titlebar | Decor_Handle | Decor_Border | - Decor_Icon | Decor_AllDesktops | Decor_Iconify | Decor_Maximize; + Decor_Icon | Decor_AllDesktops | Decor_Iconify | Decor_Maximize | + Decor_Shade; self->functions = Func_Resize | Func_Move | Func_Iconify | Func_Maximize | Func_Shade; if (self->delete_window) { @@ -842,6 +842,8 @@ void client_setup_decor_and_functions(Client *self) self->decorations &= ~Decor_Maximize; if (self->disabled_decorations & Decor_AllDesktops) self->decorations &= ~Decor_AllDesktops; + if (self->disabled_decorations & Decor_Shade) + self->decorations &= ~Decor_Shade; if (self->disabled_decorations & Decor_Close) self->decorations &= ~Decor_Close; @@ -1316,6 +1318,11 @@ void client_configure(Client *self, Corner anchor, int x, int y, int w, int h, { gboolean moved = FALSE, resized = FALSE; + /* gets the frame's position */ + frame_client_gravity(self->frame, &x, &y); + + /* these positions are frame positions, not client positions */ + /* set the size and position if fullscreen */ if (self->fullscreen) { x = 0; @@ -1335,6 +1342,9 @@ void client_configure(Client *self, Corner anchor, int x, int y, int w, int h, } } + /* gets the client's position */ + frame_frame_gravity(self->frame, &x, &y); + /* these override the above states! if you cant move you can't move! */ if (user) { if (!(self->functions & Func_Move)) { @@ -1605,13 +1615,6 @@ void client_maximize(Client *self, gboolean max, int dir, gboolean savearea) PROP_SET32A(self->window, openbox_premax, cardinal, dimensions, 4); } - - /* pass the client's current position info. the client_configure - will move/size stuff as appropriate for a maximized window */ - x = self->area.x; - y = self->area.y; - w = self->area.width; - h = self->area.height; } else { long *dimensions; @@ -1658,7 +1661,7 @@ void client_maximize(Client *self, gboolean max, int dir, gboolean savearea) void client_shade(Client *self, gboolean shade) { - if (!(self->functions & Func_Shade) || /* can't */ + if ((!(self->functions & Func_Shade) && shade) || /* can't shade */ self->shaded == shade) return; /* already done */ /* when we're iconic, don't change the wmstate */ @@ -1721,7 +1724,9 @@ void client_set_desktop(Client *self, guint target, gboolean donthide) /* 'move' the window to the new desktop */ if (!donthide) client_showhide(self); - stacking_raise(self); + /* raise if it was not already on the desktop */ + if (old != DESKTOP_ALL) + stacking_raise(self); screen_update_struts(); /* update the focus lists */