Mercurial > dwm-meillo
diff main.c @ 164:21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
author | arg@10ksloc.org |
---|---|
date | Wed, 02 Aug 2006 16:32:05 +0200 |
parents | a6a31e485fbd |
children | e848966a1ac6 |
line wrap: on
line diff
--- a/main.c Wed Aug 02 13:05:04 2006 +0200 +++ b/main.c Wed Aug 02 16:32:05 2006 +0200 @@ -4,7 +4,6 @@ */ #include "dwm.h" - #include <errno.h> #include <stdio.h> #include <stdlib.h> @@ -15,7 +14,6 @@ #include <X11/Xatom.h> #include <X11/Xproto.h> - /* static */ static int (*xerrorxlib)(Display *, XErrorEvent *); @@ -165,6 +163,7 @@ int i; unsigned int mask; fd_set rd; + Bool readin = True; Window w; XEvent ev; XSetWindowAttributes wa; @@ -251,7 +250,8 @@ /* main event loop, reads status text from stdin as well */ while(running) { FD_ZERO(&rd); - FD_SET(STDIN_FILENO, &rd); + if(readin) + FD_SET(STDIN_FILENO, &rd); FD_SET(ConnectionNumber(dpy), &rd); i = select(ConnectionNumber(dpy) + 1, &rd, 0, 0, 0); @@ -267,11 +267,12 @@ (handler[ev.type])(&ev); /* call handler */ } } - if(FD_ISSET(STDIN_FILENO, &rd)) { - if(!fgets(stext, sizeof(stext), stdin)) - break; + if(readin && FD_ISSET(STDIN_FILENO, &rd)) { + readin = NULL != fgets(stext, sizeof(stext), stdin); + if(readin) + stext[strlen(stext) - 1] = 0; else - stext[strlen(stext) - 1] = 0; + strcpy(stext, "broken pipe"); drawstatus(); } }