config check: be more precise about what we check
[awesome.git] / stack.c
blob6e16a5cdf3f3523f2cd00ee56fcae0d0ccb566df
1 /*
2 * stack.c - client stack management
4 * Copyright © 2008 Julien Danjou <julien@danjou.info>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include "stack.h"
23 #include "cnode.h"
24 #include "ewmh.h"
26 extern awesome_t globalconf;
28 /** Push the client at the beginning of the client stack.
29 * \param c The client to push.
31 void
32 stack_client_push(client_t *c)
34 client_node_t *node = client_node_client_add(&globalconf.stack, c);
35 client_node_list_push(&globalconf.stack, node);
36 ewmh_update_net_client_list_stacking(c->phys_screen);
39 /** Push the client at the end of the client stack.
40 * \param c The client to push.
42 void
43 stack_client_append(client_t *c)
45 client_node_t *node = client_node_client_add(&globalconf.stack, c);
46 client_node_list_append(&globalconf.stack, node);
47 ewmh_update_net_client_list_stacking(c->phys_screen);
50 /** Remove a client from stack history.
51 * \param c The client.
53 void
54 stack_client_delete(client_t *c)
56 client_node_t *node = client_node_client_getby(globalconf.stack, c);
58 if(node)
60 client_node_list_detach(&globalconf.stack, node);
61 p_delete(&node);
62 ewmh_update_net_client_list_stacking(c->phys_screen);
66 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80