all repos — openbox @ f1f946ea02814bc06f23d6b402d3e901cce13ee1

openbox fork - make it a bit more like ryudo

stacking fixes for layers
Dana Jansens danakj@orodu.net
commit

f1f946ea02814bc06f23d6b402d3e901cce13ee1

parent

4a34c7ddb250130e59d664862363f88eb875c01c

2 files changed, 11 insertions(+), 27 deletions(-)

jump to
M openbox/client.copenbox/client.c

@@ -282,7 +282,6 @@ self->window = window;

/* non-zero defaults */ self->wmstate = WithdrawnState; /* make sure it gets updated first time */ - self->layer = -1; self->desktop = screen_num_desktops; /* always an invalid value */ self->user_time = focus_client ? focus_client->user_time : CurrentTime;

@@ -294,8 +293,6 @@ /* the session should get the last say */

client_restore_session_state(self); client_setup_decor_and_functions(self); - - client_calc_layer(self); { Time t = sn_app_started(self->startup_id, self->class);

@@ -324,7 +321,8 @@ client_change_state(self);

grab_server(FALSE); - stacking_add_nonintrusive(CLIENT_AS_WINDOW(self)); + /* do this to add ourselves to the stacking list in a non-intrusive way */ + client_calc_layer(self); /* focus the new window? */ if (ob_state() != OB_STATE_STARTING &&

@@ -2298,7 +2296,7 @@ return l;

} static void client_calc_layer_recursive(ObClient *self, ObClient *orig, - ObStackingLayer min, gboolean raised) + ObStackingLayer min) { ObStackingLayer old, own; GSList *it;

@@ -2307,28 +2305,14 @@ old = self->layer;

own = calc_layer(self); self->layer = MAX(own, min); + if (self->layer != old) { + stacking_remove(CLIENT_AS_WINDOW(self)); + stacking_add_nonintrusive(CLIENT_AS_WINDOW(self)); + } + for (it = self->transients; it; it = g_slist_next(it)) client_calc_layer_recursive(it->data, orig, - self->layer, - raised ? raised : self->layer > old); - - /* 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_nonintrusive(CLIENT_AS_WINDOW(self)); - } - } + self->layer); } void client_calc_layer(ObClient *self)

@@ -2342,7 +2326,7 @@ /* transients take on the layer of their parents */

it = client_search_all_top_parents(self); for (; it; it = g_slist_next(it)) - client_calc_layer_recursive(it->data, orig, 0, FALSE); + client_calc_layer_recursive(it->data, orig, 0); } gboolean client_should_show(ObClient *self)
M openbox/stacking.copenbox/stacking.c

@@ -426,7 +426,7 @@ it_below = it_below->next;

} } if (!it_below) { - if (client == focus_client) { + if (client_search_transient(client, focus_client)) { /* it's focused so put it at the top */ stacking_list = g_list_append(stacking_list, win); stacking_raise(win);