raised to the top. Legacy begets legacy I guess?
*/
if (!client_restore_session_stacking(self))
- client_raise(self);
+ stacking_raise(CLIENT_AS_WINDOW(self));
}
/* this has to happen before we try focus the window, but we want it to
/* kill the handle on fully maxed windows */
if (self->max_vert && self->max_horz)
- self->decorations &= ~OB_FRAME_DECOR_HANDLE;
+ self->decorations &= ~(OB_FRAME_DECOR_HANDLE | OB_FRAME_DECOR_GRIPS);
/* finally, the user can have requested no decorations, which overrides
everything (but doesnt give it a border if it doesnt have one) */
for (it = self->transients; it; it = g_slist_next(it))
client_calc_layer_recursive(it->data, orig,
self->layer,
- raised ? raised : self->layer != old);
+ raised ? raised : self->layer > old);
- if (!raised && self->layer != old)
- if (orig->frame) { /* only restack if the original window is managed */
+ /* restack. but only if the original window is managed.
+
+ raised is used so that only the bottom-most window in the stacking
+ order is raised, the others will automatically come with it.
+
+ also only the highest windows in the stacking order (no transients)
+ are lowered, cuz the rest come for free
+ */
+ if (!raised && orig->frame) {
+ if (self->layer > old) {
+ stacking_remove(CLIENT_AS_WINDOW(self));
+ stacking_add_nonintrusive(CLIENT_AS_WINDOW(self));
+ } else if (self->layer < old && self->transients == NULL) {
stacking_remove(CLIENT_AS_WINDOW(self));
- stacking_add(CLIENT_AS_WINDOW(self));
+ stacking_add_nonintrusive(CLIENT_AS_WINDOW(self));
}
+ }
}
void client_calc_layer(ObClient *self)
client_showhide(self);
/* raise if it was not already on the desktop */
if (old != DESKTOP_ALL)
- client_raise(self);
+ stacking_raise(CLIENT_AS_WINDOW(self));
if (STRUT_EXISTS(self->strut))
screen_update_areas();
}
self->modal = modal;
/* when a window changes modality, then its stacking order with its
transients needs to change */
- client_raise(self);
+ stacking_raise(CLIENT_AS_WINDOW(self));
}
if (iconic != self->iconic)
client_iconify(self, iconic, FALSE);
return;
if (self->shaded)
client_shade(self, FALSE);
+ if (raise)
+ stacking_raise(CLIENT_AS_WINDOW(self));
client_focus(self);
-
- if (raise) {
- /* we do this as an action here. this is rather important. this is
- because we want the results from the focus change to take place
- BEFORE we go about raising the window. when a fullscreen window
- loses focus, we need this or else the raise wont be able to raise
- above the to-lose-focus fullscreen window. */
- client_raise(self);
- }
}
void client_activate(ObClient *self, gboolean here, gboolean user)
client_bring_helper_windows_recursive(self, self->desktop);
}
-void client_raise(ObClient *self)
-{
- action_run_string("Raise", self, CurrentTime);
-}
-
-void client_lower(ObClient *self)
-{
- action_run_string("Lower", self, CurrentTime);
-}
-
gboolean client_focused(ObClient *self)
{
return self == focus_client;