only add non-nonintrusively when both windows share a stacking layer

This commit is contained in:
Dana Jansens 2003-05-29 15:24:56 +00:00
parent 6ddb059783
commit 3424de66b2

View file

@ -110,6 +110,8 @@ void stacking_raise(ObWindow *window)
{ {
g_assert(stacking_list != NULL); /* this would be bad */ g_assert(stacking_list != NULL); /* this would be bad */
g_message("RAISING");
if (WINDOW_IS_CLIENT(window)) { if (WINDOW_IS_CLIENT(window)) {
Client *client = WINDOW_AS_CLIENT(window); Client *client = WINDOW_AS_CLIENT(window);
@ -243,14 +245,15 @@ void stacking_add_nonintrusive(ObWindow *win)
if (!(it_before = g_list_find(stacking_list, parent))) { if (!(it_before = g_list_find(stacking_list, parent))) {
/* no parent to put above, try find the focused client to go /* no parent to put above, try find the focused client to go
under */ under */
if (focus_client && focus_client->layer == client->layer) {
if ((it_before = g_list_find(stacking_list, focus_client))) if ((it_before = g_list_find(stacking_list, focus_client)))
it_before = it_before->next; it_before = it_before->next;
else { }
}
if (!it_before) {
/* out of ideas, just add it normally... */ /* out of ideas, just add it normally... */
stacking_add(win); stacking_add(win);
return; } else {
}
}
stacking_list = g_list_insert_before(stacking_list, it_before,win); stacking_list = g_list_insert_before(stacking_list, it_before,win);
it_before = g_list_find(stacking_list, win)->prev; it_before = g_list_find(stacking_list, win)->prev;
@ -263,3 +266,4 @@ void stacking_add_nonintrusive(ObWindow *win)
XRestackWindows(ob_display, wins, 2); XRestackWindows(ob_display, wins, 2);
} }
} }
}