tignw: either set or reset the overrid_redirect attribute - wmutils - X windows manipulation utilities
(HTM) git clone git://z3bra.org/wmutils
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 828eba9ac1233d815d578c1d8e7a516346e71f5f
(DIR) parent b19d27d718337a349f97d687f43eb8fde06575cf
(HTM) Author: z3bra <willy@mailoo.org>
Date: Wed, 3 Dec 2014 23:07:03 +0100
ignw: either set or reset the overrid_redirect attribute
Diffstat:
M ignw.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/ignw.c b/ignw.c
t@@ -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);
t@@ -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);
}
t@@ -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);