tMove wm_is_listable() with other state-check functions - libwm - X windows manipulation library
 (HTM) git clone git://z3bra.org/libwm
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 5d78292a0e2d5a329a279f6dabdc4da9c7df1996
 (DIR) parent c1137a74cfbbaae29096475a4f631406cb338e43
 (HTM) Author: Willy Goiffon <dev@z3bra.org>
       Date:   Sat, 26 Oct 2019 11:50:24 +0200
       
       Move wm_is_listable() with other state-check functions
       
       Diffstat:
         M libwm.c                             |      27 +++++++++++++++------------
       
       1 file changed, 15 insertions(+), 12 deletions(-)
       ---
 (DIR) diff --git a/libwm.c b/libwm.c
       t@@ -79,6 +79,21 @@ wm_is_ignored(xcb_window_t wid)
        }
        
        int
       +wm_is_listable(xcb_window_t wid, int mask)
       +{
       +        if (!mask && wm_is_mapped (wid) && !wm_is_ignored(wid))
       +                return 1;
       +        if ((mask & LIST_ALL)
       +                return 1;
       +        if (!wm_is_mapped (wid) && mask & LIST_HIDDEN)
       +                return 1;
       +        if (wm_is_ignored(wid) && mask & LIST_IGNORE)
       +                return 1;
       +
       +        return 0;
       +}
       +
       +int
        wm_get_screen()
        {
                scrn = xcb_setup_roots_iterator(xcb_get_setup(conn)).data;
       t@@ -241,18 +256,6 @@ wm_set_cursor(int x, int y, int mode)
        {
                xcb_warp_pointer(conn, XCB_NONE, mode ? XCB_NONE : scrn->root,
                                0, 0, 0, 0, x, y);
       -        return 1;
       -}
       -
       -int
       -wm_is_listable(xcb_window_t wid, int mask)
       -{
       -        if ((mask & LIST_ALL)
       -                || (!wm_is_mapped (wid) && mask & LIST_HIDDEN)
       -                || ( wm_is_ignored(wid) && mask & LIST_IGNORE)
       -                || ( wm_is_mapped (wid) && !wm_is_ignored(wid) && mask == 0))
       -                return 1;
       -
                return 0;
        }