]> Dogcows Code - chaz/openbox/blobdiff - openbox/stacking.c
make _NET_ACTIVE_WINDOW requests look at the timestamp when the user didn't
[chaz/openbox] / openbox / stacking.c
index 6050d0178e49880295a98f1001d5a03d764c59c0..ff5a943be9a03a4f1c870e978d545cbf76a0dcb6 100644 (file)
@@ -1,6 +1,7 @@
 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
 
    stacking.c for the Openbox window manager
+   Copyright (c) 2006        Mikael Magnusson
    Copyright (c) 2003        Ben Jansens
 
    This program is free software; you can redistribute it and/or modify
@@ -283,7 +284,8 @@ void stacking_raise(ObWindow *window, gboolean group)
         selected = WINDOW_AS_CLIENT(window);
         c = client_search_top_transient(selected);
         wins = pick_windows(c, selected, TRUE);
-        wins = g_list_concat(wins, pick_group_windows(c, selected, TRUE, group));
+        wins = g_list_concat(wins,
+                             pick_group_windows(c, selected, TRUE, group));
     } else {
         wins = g_list_append(NULL, window);
         stacking_list = g_list_remove(stacking_list, window);
@@ -302,7 +304,8 @@ void stacking_lower(ObWindow *window, gboolean group)
         selected = WINDOW_AS_CLIENT(window);
         c = client_search_top_transient(selected);
         wins = pick_windows(c, selected, FALSE);
-        wins = g_list_concat(pick_group_windows(c, selected, FALSE, group), wins);
+        wins = g_list_concat(pick_group_windows(c, selected, FALSE, group),
+                             wins);
     } else {
         wins = g_list_append(NULL, window);
         stacking_list = g_list_remove(stacking_list, window);
@@ -382,6 +385,15 @@ void stacking_add_nonintrusive(ObWindow *win)
         /* out of ideas, just add it normally... */
         stacking_add(win);
     } else {
+        GList *it;
+
+        /* make sure it's not in the wrong layer though ! */
+        while (it_before && client->layer < ((ObClient*)it_before->data)->layer)
+            it_before = g_list_next(it_before);
+        while (it_before != stacking_list &&
+               client->layer > ((ObClient*)g_list_previous(it_before)->data)->layer)
+            it_before = g_list_previous(it_before);
+
         GList *wins = g_list_append(NULL, win);
         do_restack(wins, it_before);
         g_list_free(wins);
This page took 0.026085 seconds and 4 git commands to generate.