]> Dogcows Code - chaz/openbox/commitdiff
when focusing or raising a window which is modal child for a direct parent, raise...
authorDana Jansens <danakj@orodu.net>
Sun, 3 Feb 2008 03:17:32 +0000 (22:17 -0500)
committerDana Jansens <danakj@orodu.net>
Sun, 3 Feb 2008 03:17:32 +0000 (22:17 -0500)
openbox/focus.c
openbox/stacking.c

index a4eb2cfa32a76b000c16d6f7d2160519382ed49a..c2d7e11e5dd879d8a776fd7bfb65ce0524d1d3db 100644 (file)
@@ -57,6 +57,14 @@ void focus_shutdown(gboolean reconfig)
 
 static void push_to_top(ObClient *client)
 {
+    ObClient *p;
+
+    /* if it is modal for a single window, then put that window at the top
+       of the focus order first, so it will be right after ours. the same is
+       done with stacking */
+    if (client->modal && (p = client_direct_parent(client)))
+        push_to_top(p);
+
     focus_order = g_list_remove(focus_order, client);
     focus_order = g_list_prepend(focus_order, client);
 }
index 92a5285d79f3a1ec22882868bbccd136fa5a7675..4c24e3e87f06ed2414006f41abe266e3872ba7a9 100644 (file)
@@ -221,6 +221,15 @@ static void restack_windows(ObClient *selected, gboolean raise)
     GList *modals = NULL;
     GList *trans = NULL;
 
+    if (raise) {
+        ObClient *p;
+
+        /* if a window is modal for another single window, then raise it to the
+           top too, the same is done with the focus order */
+        while (selected->modal && (p = client_direct_parent(selected)))
+            selected = p;
+    }
+
     /* remove first so we can't run into ourself */
     it = g_list_find(stacking_list, selected);
     g_assert(it);
This page took 0.027592 seconds and 4 git commands to generate.