X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=c5d1daa67be3516e78f78b833eebb08425f5f356;hb=95ffd99cfab5ffc46d3b12f2c1c7c8ac73e70337;hp=e47742a64a2814f471ea1e684c589e3e8e6fcaea;hpb=d56e90fac8e821f3773372e9342d60de169963b9;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index e47742a6..c5d1daa6 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,21 @@ void client_manage_all() } } XFree(children); + + /* stack them as they were on startup! + why with stacking_lower? Why, because then windows who aren't in the + stacking list are on the top where you can see them instead of buried + at the bottom! */ + 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); + } + g_free(client_startup_stack_order); + client_startup_stack_order = NULL; + client_startup_stack_size = 0; } void client_manage(Window window)