X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=5cc1df9a3cab46b28eac80d88bcd8784f4c1f6ed;hb=a0941554f6cfc29dfd4b0da0b5ce83fdd719efa7;hp=875c790bd8e727cc222b1796e2fef3add29718a5;hpb=119c48fc6c90da5ebb2fc59425bbdb30f4576e47;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 875c790b..5cc1df9a 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -403,20 +403,26 @@ void client_manage(Window window) frame_adjust_client_area(self->frame); + /* do this after the window is placed, so the premax/prefullscreen numbers + won't be all wacko!! + also, this moves the window to the position where it has been placed + */ + client_apply_startup_state(self); + /* move the client to its placed position, or it it's already there, generate a ConfigureNotify telling the client where it is. do this after adjusting the frame. otherwise it gets all weird and - clients don't work right */ + clients don't work right + + also do this after applying the startup state so maximize and fullscreen + will get the right sizes and positions if the client is starting with + those states + */ client_configure(self, self->area.x, self->area.y, self->area.width, self->area.height, FALSE, TRUE); - /* do this after the window is placed, so the premax/prefullscreen numbers - won't be all wacko!! - also, this moves the window to the position where it has been placed - */ - client_apply_startup_state(self); if (activate) { guint32 last_time = focus_client ? @@ -649,6 +655,8 @@ void client_unmanage(ObClient *self) } self->fullscreen = self->max_horz = self->max_vert = FALSE; + /* let it be moved and resized no matter what */ + self->functions = OB_CLIENT_FUNC_MOVE | OB_CLIENT_FUNC_RESIZE; self->decorations = 0; /* unmanaged windows have no decor */ client_move_resize(self, a.x, a.y, a.width, a.height); @@ -1582,6 +1590,8 @@ void client_update_normal_hints(ObClient *self) } } +/*! This needs to be followed by a call to client_configure to make + the changes show */ void client_setup_decor_and_functions(ObClient *self) { /* start with everything (cept fullscreen) */ @@ -1635,11 +1645,13 @@ void client_setup_decor_and_functions(ObClient *self) do with them is move them */ self->decorations = 0; self->functions = OB_CLIENT_FUNC_MOVE; + break; case OB_CLIENT_TYPE_DESKTOP: /* these windows are not manipulated by the window manager */ self->decorations = 0; self->functions = 0; + break; case OB_CLIENT_TYPE_DOCK: /* these windows are not manipulated by the window manager, but they @@ -1685,10 +1697,6 @@ void client_setup_decor_and_functions(ObClient *self) } } - /* can't resize maximized windows */ - if (self->max_horz && self->max_vert) - self->functions &=~ OB_CLIENT_FUNC_RESIZE; - if (!(self->functions & OB_CLIENT_FUNC_SHADE)) self->decorations &= ~OB_FRAME_DECOR_SHADE; if (!(self->functions & OB_CLIENT_FUNC_ICONIFY)) @@ -1704,6 +1712,10 @@ void client_setup_decor_and_functions(ObClient *self) self->decorations &= ~OB_FRAME_DECOR_MAXIMIZE; } + if (self->max_horz && self->max_vert) + /* kill the handle on fully maxed windows */ + self->decorations &= ~(OB_FRAME_DECOR_HANDLE | OB_FRAME_DECOR_GRIPS); + /* If there are no decorations to remove, don't allow the user to try toggle the state */ if (self->decorations == 0) @@ -1731,11 +1743,6 @@ void client_setup_decor_and_functions(ObClient *self) } client_change_allowed_actions(self); - - if (self->frame) { - /* adjust the client's decorations, etc. */ - client_reconfigure(self); - } } static void client_change_allowed_actions(ObClient *self) @@ -3090,7 +3097,7 @@ void client_set_desktop_recursive(ObClient *self, guint old; GSList *it; - if (target != self->desktop) { + if (target != self->desktop && self->type != OB_CLIENT_TYPE_DESKTOP) { ob_debug("Setting desktop %u\n", target+1); @@ -3606,6 +3613,7 @@ void client_set_undecorated(ObClient *self, gboolean undecorated) { self->undecorated = undecorated; client_setup_decor_and_functions(self); + client_reconfigure(self); /* show the lack of decorations */ client_change_state(self); /* reflect this in the state hints */ } }