diff options
-rw-r--r-- | xdeadzone.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/xdeadzone.c b/xdeadzone.c index 6ec1e10..a0398a8 100644 --- a/xdeadzone.c +++ b/xdeadzone.c @@ -68,7 +68,7 @@ int main(int argc, char **argv) { XWindowAttributes attr; XSetWindowAttributes setattr; - int x = -1, y = -1, gflags; + int x = -1, y = -1, gflags, visible = 0, black = 0; unsigned int width, height; set_exe_name(argv[0]); @@ -82,6 +82,24 @@ int main(int argc, char **argv) { } } + if(argc >= 2) { + if(streq(argv[1], "-b")) { + visible = 1; + black = 1; + argv++; + argc--; + } else if(streq(argv[1], "-w")) { + visible = 1; + black = 0; + argv++; + argc--; + } else if(streq(argv[1], "-i")) { + visible = 0; + argv++; + argc--; + } + } + if(argc != 3) errmsg("wrong number of arguments (try --help)"); @@ -129,7 +147,11 @@ int main(int argc, char **argv) { right? */ setattr.override_redirect = True; - setattr.background_pixel = WhitePixel(d, DefaultScreen(d)); + if(visible) { + setattr.background_pixel = black ? + BlackPixel(d, DefaultScreen(d)) : + WhitePixel(d, DefaultScreen(d)); + } setattr.event_mask = EnterWindowMask; w = XCreateWindow(d, @@ -138,7 +160,7 @@ int main(int argc, char **argv) { CopyFromParent, InputOutput, CopyFromParent, - CWBackPixel | CWOverrideRedirect | CWEventMask, + (visible ? CWBackPixel : 0) | CWOverrideRedirect | CWEventMask, &setattr); DBG(printf("window created\n")); |