summaryrefslogtreecommitdiff
path: root/openbox/client.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-03-25 00:39:28 +0000
committerDana Jansens <danakj@orodu.net>2003-03-25 00:39:28 +0000
commite731042dc9f45555fbb1c52e2affaaf6ffeb141f (patch)
tree8834849fd1a1a16252c017834f36e0a405984e58 /openbox/client.c
parent990b74a49e45e5715c131328b7e1464c5f5ccf6e (diff)
read in the stacking order on startup, and use it to restore windows back to the order they were in before
Diffstat (limited to 'openbox/client.c')
-rw-r--r--openbox/client.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/openbox/client.c b/openbox/client.c
index e47742a6..6d32c407 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -23,6 +23,9 @@
GSList *client_list = NULL;
GHashTable *client_map = NULL;
+static Window *client_startup_stack_order = NULL;
+static gulong client_startup_stack_size = 0;
+
static void client_get_all(Client *self);
static void client_toggle_border(Client *self, gboolean show);
static void client_get_area(Client *self);
@@ -45,6 +48,13 @@ void client_startup()
{
client_map = g_hash_table_new((GHashFunc)map_hash,
(GEqualFunc)map_key_comp);
+
+ /* save the stacking order on startup! */
+ if (!PROP_GET32U(ob_root, net_client_list_stacking, window,
+ client_startup_stack_order, client_startup_stack_size))
+ g_message("failed");
+ g_message("%ld", client_startup_stack_size);
+
client_set_list();
}
@@ -112,6 +122,15 @@ void client_manage_all()
}
}
XFree(children);
+
+ /* stack them as they were on startup! */
+ for (i = client_startup_stack_size; i > 0; --i) {
+ Client *c;
+
+ w = client_startup_stack_order[i-1];
+ c = g_hash_table_lookup(client_map, &w);
+ if (c) stacking_lower(c);
+ }
}
void client_manage(Window window)