wmutils

X windows manipulation utilities
git clone git://z3bra.org/wmutils
Log | Files | Refs | LICENSE

commit 828eba9ac1233d815d578c1d8e7a516346e71f5f
parent b19d27d718337a349f97d687f43eb8fde06575cf
Author: z3bra <willy@mailoo.org>
Date:   Wed Dec  3 23:07:03 2014

ignw: either set or reset the overrid_redirect attribute

Diffstat:
 ignw.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/ignw.c b/ignw.c @@ -13,6 +13,13 @@ static void cleanup(void); static void ignore(xcb_window_t); static void +usage(void) +{ + fprintf(stderr, "usage: %s [-sr] <wid> [wid..]\n", argv0); + exit(1); +} + +static void xcbinit(void) { conn = xcb_connect(NULL, NULL); @@ -28,10 +35,10 @@ cleanup(void) } static void -ignore(xcb_window_t w) +setoverride(xcb_window_t w, int or) { uint32_t mask = XCB_CW_OVERRIDE_REDIRECT; - uint32_t val[] = { 1 }; + uint32_t val[] = { or }; xcb_change_window_attributes(conn, w, mask, val); } @@ -39,11 +46,18 @@ ignore(xcb_window_t w) int main(int argc, char **argv) { + int setflag = 0; + + ARGBEGIN { + case 's': setflag = 1; break; + case 'r': setflag = 0; break; + default: usage(); + } ARGEND; atexit(cleanup); xcbinit(); while (*argv) - ignore(strtoul(*argv++, NULL, 16)); + setoverride(strtoul(*argv++, NULL, 16), setflag); xcb_flush(conn);