summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-05-29 15:24:56 +0000
committerDana Jansens <danakj@orodu.net>2003-05-29 15:24:56 +0000
commit3424de66b2fa48f259e3892da3ad0a6427f389b4 (patch)
tree8e30ace784443ddb0b2e3f1b0fec8b3e9a44c594 /openbox
parent6ddb05978307acaec6262c6f2fe06c64602e8883 (diff)
only add non-nonintrusively when both windows share a stacking layer
Diffstat (limited to 'openbox')
-rw-r--r--openbox/stacking.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/openbox/stacking.c b/openbox/stacking.c
index d6112469..f0c13d6d 100644
--- a/openbox/stacking.c
+++ b/openbox/stacking.c
@@ -110,6 +110,8 @@ void stacking_raise(ObWindow *window)
{
g_assert(stacking_list != NULL); /* this would be bad */
+ g_message("RAISING");
+
if (WINDOW_IS_CLIENT(window)) {
Client *client = WINDOW_AS_CLIENT(window);
@@ -243,23 +245,25 @@ void stacking_add_nonintrusive(ObWindow *win)
if (!(it_before = g_list_find(stacking_list, parent))) {
/* no parent to put above, try find the focused client to go
under */
- if ((it_before = g_list_find(stacking_list, focus_client)))
- it_before = it_before->next;
- else {
- /* out of ideas, just add it normally... */
- stacking_add(win);
- return;
+ if (focus_client && focus_client->layer == client->layer) {
+ if ((it_before = g_list_find(stacking_list, focus_client)))
+ it_before = it_before->next;
}
}
- stacking_list = g_list_insert_before(stacking_list, it_before, win);
-
- it_before = g_list_find(stacking_list, win)->prev;
- if (!it_before)
- wins[0] = focus_backup;
- else
- wins[0] = window_top(it_before->data);
- wins[1] = window_top(win);
-
- XRestackWindows(ob_display, wins, 2);
+ if (!it_before) {
+ /* out of ideas, just add it normally... */
+ stacking_add(win);
+ } else {
+ stacking_list = g_list_insert_before(stacking_list, it_before,win);
+
+ it_before = g_list_find(stacking_list, win)->prev;
+ if (!it_before)
+ wins[0] = focus_backup;
+ else
+ wins[0] = window_top(it_before->data);
+ wins[1] = window_top(win);
+
+ XRestackWindows(ob_display, wins, 2);
+ }
}
}