diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-05-10 00:57:35 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-05-10 00:57:35 +0000 |
| commit | 98304406432cda3a94c2a57f0812714a229ec77a (patch) | |
| tree | 96fdf5a1b20e79a3c1598e0cc670688aa514707e /openbox/client.c | |
| parent | 6412fba7fd1a30465cb01b0e3ebcdf47680e9f02 (diff) | |
make restacking much better, yay
no more cludge using actions to raise windows. when a window changes layer it
uses add_nonintrusive now so it won't cover the focused window. this way
fullscreen windows when they drop down, don't cover up the new focus target.
fix add_nonintrusive so that if the window is focused it gets added to the top
add back support for ConfigureRequest restacking, this time properly though,
using all the detail and sibling modes. but when windows use this to raise they
are using some old business and we're going to assume they actually want to
activate instead. this means firefox works nicely. yay.
ubuntu's firefox has been made to just stop raising entirely though. !
Diffstat (limited to 'openbox/client.c')
| -rw-r--r-- | openbox/client.c | 47 |
1 files changed, 21 insertions, 26 deletions
diff --git a/openbox/client.c b/openbox/client.c index 0c4cce1f..4c88daf7 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -451,7 +451,7 @@ void client_manage(Window window) 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 @@ -2344,13 +2344,25 @@ static void client_calc_layer_recursive(ObClient *self, ObClient *orig, 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) @@ -3077,7 +3089,7 @@ void client_set_desktop_recursive(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(); } @@ -3302,7 +3314,7 @@ void client_set_state(ObClient *self, Atom action, glong data1, glong data2) 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); @@ -3444,17 +3456,10 @@ static void client_present(ObClient *self, gboolean here, gboolean raise) 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) @@ -3510,16 +3515,6 @@ void client_bring_helper_windows(ObClient *self) 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; |
