* set the override_redirect flag. Clients are organized in a global
* doubly-linked client list, the focus history is remembered through a global
* stack list. Each client contains an array of Bools of the same size as the
- * global tags array to indicate the tags of a client. For each client dwm
- * creates a small title window, which is resized whenever the (_NET_)WM_NAME
- * properties are updated or the client is moved/resized.
+ * global tags array to indicate the tags of a client.
*
* Keys and tagging rules are organized as arrays and defined in config.h.
*
readin = running = False;
}
+
void
resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
XWindowChanges wc;
void
run(void) {
+ char *p;
fd_set rd;
- int xfd;
+ int r, xfd;
+ unsigned int len, offset;
XEvent ev;
/* main event loop, also reads status text from stdin */
XSync(dpy, False);
xfd = ConnectionNumber(dpy);
readin = True;
- stext[sizeof stext - 1] = '\0'; /* 0-terminator is never touched */
+ offset = 0;
+ len = sizeof stext - 1;
+ stext[len] = '\0'; /* 0-terminator is never touched */
while(running) {
FD_ZERO(&rd);
if(readin)
eprint("select failed\n");
}
if(FD_ISSET(STDIN_FILENO, &rd)) {
- if((readin = (stext == fgets(stext, sizeof stext - 1, stdin))))
- stext[strlen(stext) - 1] = '\0'; /* remove tailing '\n' */
- else if(feof(stdin))
+ switch((r = read(STDIN_FILENO, stext + offset, len - offset))) {
+ case -1:
+ strncpy(stext, strerror(errno), len);
+ readin = False;
+ break;
+ case 0:
strncpy(stext, "EOF", 4);
- else /* error occured */
- strncpy(stext, strerror(errno), sizeof stext - 1);
+ readin = False;
+ break;
+ default:
+ stext[offset + r] = '\0';
+ for(p = stext; *p && *p != '\n'; p++);
+ if(*p == '\n') {
+ *p = '\0';
+ offset = 0;
+ }
+ else
+ offset = (offset + r < len - 1) ? offset + r : 0;
+ }
drawbar();
}
while(XPending(dpy)) {
int
main(int argc, char *argv[]) {
if(argc == 2 && !strcmp("-v", argv[1]))
- eprint("dwm-"VERSION", © 2006-2007 A. R. Garbe, S. van Dijk, J. Salmi, P. Hruby, S. Nagy\n");
+ eprint("dwm-"VERSION", © 2006-2007 Anselm R. Garbe, Sander van Dijk, "
+ "Jukka Salmi, Premysl Hruby, Szabolcs Nagy\n");
else if(argc != 1)
eprint("usage: dwm [-v]\n");