Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | removed a bunch of lines through making function signatures more consistent ↵ | Anselm R. Garbe | 2006-09-12 | 1 | -19/+11 |
| | | | | with my style ( { does not belong to a new line, if function args are single-lined) | ||||
* | applied Christof Musik's multihead patch for a pathologic cornercase | Anselm R. Garbe | 2006-09-12 | 1 | -1/+2 |
| | |||||
* | fixed some other comments, now also the code side seems to be at a level to ↵ | Anselm R. Garbe | 2006-09-11 | 1 | -2/+2 |
| | | | | be reviewed by experienced programmers | ||||
* | using a global stack for focus recovery on arrange() - seems to work great | Anselm R. Garbe | 2006-09-07 | 1 | -0/+1 |
| | |||||
* | small fix | Anselm R. Garbe | 2006-09-06 | 1 | -0/+1 |
| | |||||
* | applied Sanders max_and_focus.patch | Anselm R. Garbe | 2006-09-04 | 1 | -0/+1 |
| | |||||
* | trying a different configuration | Anselm R. Garbe | 2006-08-25 | 1 | -3/+3 |
| | |||||
* | fixed typo | Anselm R. Garbe | 2006-08-25 | 1 | -1/+1 |
| | |||||
* | removed a bunch of lines, made mode symbols configurable | Anselm R. Garbe | 2006-08-25 | 1 | -1/+1 |
| | |||||
* | new color stuff/new rendering stuff | Anselm R. Garbe | 2006-08-25 | 1 | -5/+9 |
| | |||||
* | back to 3 colors | Anselm R. Garbe | 2006-08-25 | 1 | -4/+3 |
| | |||||
* | 3->4 colors | Anselm R. Garbe | 2006-08-24 | 1 | -3/+4 |
| | |||||
* | changing tag indicator through underline | Anselm R. Garbe | 2006-08-24 | 1 | -0/+1 |
| | |||||
* | removed a blank line | Anselm R. Garbe | 2006-08-23 | 1 | -1/+0 |
| | |||||
* | separated setup stuff into main.c:setup() - this makes main() more readable | Anselm R. Garbe | 2006-08-23 | 1 | -86/+95 |
| | |||||
* | rearranged getproto | Anselm R. Garbe | 2006-08-22 | 1 | -6/+5 |
| | |||||
* | removed winprop (merged into getproto) | Anselm R. Garbe | 2006-08-22 | 1 | -27/+7 |
| | |||||
* | removed DEFTAG | Anselm R. Garbe | 2006-08-22 | 1 | -1/+1 |
| | |||||
* | small renamings of two static functions | Anselm R.Garbe | 2006-08-21 | 1 | -2/+2 |
| | |||||
* | small changes to dwm.1, rearranged order within main event loop | Anselm R.Garbe | 2006-08-21 | 1 | -4/+4 |
| | |||||
* | corrected order of cleanup code | Anselm R.Garbe | 2006-08-16 | 1 | -1/+1 |
| | |||||
* | we close stdin as well | Anselm R.Garbe | 2006-08-16 | 1 | -3/+4 |
| | |||||
* | extended cleanup | Anselm R.Garbe | 2006-08-15 | 1 | -0/+7 |
| | |||||
* | applied jk_to_tab patch | Anselm R.Garbe | 2006-08-15 | 1 | -2/+1 |
| | |||||
* | changed main event loop | Anselm R.Garbe | 2006-08-15 | 1 | -10/+7 |
| | |||||
* | removed NUMLOCKMASK, added dynamically calculated numlockmask instead | Anselm R.Garbe | 2006-08-14 | 1 | -7/+19 |
| | |||||
* | changed order of selecting input at root window | Anselm R.Garbe | 2006-08-14 | 1 | -4/+4 |
| | |||||
* | removed unneecessary crap | Anselm R.Garbe | 2006-08-14 | 1 | -1/+0 |
| | |||||
* | some other small fixes | Anselm R.Garbe | 2006-08-14 | 1 | -8/+8 |
| | |||||
* | removed ungrabkeys again (because of sander's mail) | Anselm R.Garbe | 2006-08-14 | 1 | -1/+0 |
| | |||||
* | implemented ungrabkeys() which is called in cleanup() | Anselm R.Garbe | 2006-08-14 | 1 | -0/+1 |
| | |||||
* | supplying NULL args in select | Anselm R.Garbe | 2006-08-14 | 1 | -1/+1 |
| | |||||
* | reducing ConnectionNumber calls to a bare minimum | Anselm R.Garbe | 2006-08-14 | 1 | -4/+5 |
| | |||||
* | implemented viewextend and added M-S-C-n shortcuts for extending the current ↵ | Anselm R.Garbe | 2006-08-11 | 1 | -3/+3 |
| | | | | view... updated man page (works great!) nice feature | ||||
* | implement multi-tag selection through button3 click on the specific tag | Anselm R.Garbe | 2006-08-11 | 1 | -1/+3 |
| | |||||
* | prepared 0.8 0.8 | Anselm R.Garbe | 2006-08-10 | 1 | -0/+1 |
| | |||||
* | readded border color, this sucks least | Anselm R.Garbe | 2006-08-10 | 1 | -0/+1 |
| | |||||
* | removed unnecessary border color | Anselm R.Garbe | 2006-08-10 | 1 | -1/+0 |
| | |||||
* | removed NET_ACTIVE_WINDOW handling | Anselm R.Garbe | 2006-08-08 | 1 | -1/+0 |
| | |||||
* | implemented NET_ACTIVE_WINDOW support | Anselm R.Garbe | 2006-08-08 | 1 | -0/+1 |
| | |||||
* | applied Sanders tiny patches | Anselm R.Garbe | 2006-08-08 | 1 | -1/+2 |
| | |||||
* | small fix of a comment | arg@10ksloc.org | 2006-08-07 | 1 | -1/+1 |
| | |||||
* | changed getproto, maybe that might fix the killclient issue reported on the list | arg@10ksloc.org | 2006-08-07 | 1 | -2/+3 |
| | |||||
* | slight fix | arg@10ksloc.org | 2006-08-05 | 1 | -3/+2 |
| | |||||
* | switched to regexp matching for Rules | arg@10ksloc.org | 2006-08-04 | 1 | -0/+1 |
| | |||||
* | removed TLast tag enum, now tags is simple defined as char *[] array, the ↵ | arg@10ksloc.org | 2006-08lass="w"> NULL; if(XQueryTree(dpy, root, &d1, &d2, &wins, &num)) { for(i = 0; i < num; i++) { if(!XGetWindowAttributes(dpy, wins[i], &wa)) continue; if(wa.override_redirect || XGetTransientForHint(dpy, wins[i], &d1)) continue; if(wa.map_state == IsViewable) manage(wins[i], &wa); } } if(wins) XFree(wins); } static void setup() { int i, j; unsigned int mask; Window w; XModifierKeymap *modmap; XSetWindowAttributes wa; /* init atoms */ wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32, PropModeReplace, (unsigned char *) netatom, NetLast); /* init cursors */ cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr); cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing); cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur); modmap = XGetModifierMapping(dpy); for (i = 0; i < 8; i++) { for (j = 0; j < modmap->max_keypermod; j++) { if(modmap->modifiermap[i * modmap->max_keypermod + j] == XKeysymToKeycode(dpy, XK_Num_Lock)) numlockmask = (1 << i); } } XFree(modmap); wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask | EnterWindowMask | LeaveWindowMask; wa.cursor = cursor[CurNormal]; XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa); grabkeys(); initrregs(); for(ntags = 0; tags[ntags]; ntags++); seltag = emallocz(sizeof(Bool) * ntags); seltag[0] = True; /* style */ dc.norm[ColBG] = getcolor(NORMBGCOLOR); dc.norm[ColFG] = getcolor(NORMFGCOLOR); dc.sel[ColBG] = getcolor(SELBGCOLOR); dc.sel[ColFG] = getcolor(SELFGCOLOR); dc.status[ColBG] = getcolor(STATUSBGCOLOR); dc.status[ColFG] = getcolor(STATUSFGCOLOR); setfont(FONT); bmw = textw(FLOATSYMBOL) > textw(TILESYMBOL) ? textw(FLOATSYMBOL) : textw(TILESYMBOL); sx = sy = 0; sw = DisplayWidth(dpy, screen); sh = DisplayHeight(dpy, screen); mw = (sw * MASTERW) / 100; bx = by = 0; bw = sw; dc.h = bh = dc.font.height + 2; wa.override_redirect = 1; wa.background_pixmap = ParentRelative; wa.event_mask = ButtonPressMask | ExposureMask; barwin = XCreateWindow(dpy, root, bx, by, bw, bh, 0, DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); XDefineCursor(dpy, barwin, cursor[CurNormal]); XMapRaised(dpy, barwin); dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen)); dc.gc = XCreateGC(dpy, root, 0, 0); XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); issel = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask); strcpy(stext, "dwm-"VERSION); } /* * Startup Error handler to check if another window manager * is already running. */ static int xerrorstart(Display *dsply, XErrorEvent *ee) { otherwm = True; return -1; } /* extern */ int getproto(Window w) { int i, format, protos, status; unsigned long extra, res; Atom *protocols, real; protos = 0; status = XGetWindowProperty(dpy, w, wmatom[WMProtocols], 0L, 20L, False, XA_ATOM, &real, &format, &res, &extra, (unsigned char **)&protocols); if(status != Success || protocols == 0) return protos; for(i = 0; i < res; i++) if(protocols[i] == wmatom[WMDelete]) protos |= PROTODELWIN; free(protocols); return protos; } void sendevent(Window w, Atom a, long value) { XEvent e; e.type = ClientMessage; e.xclient.window = w; e.xclient.message_type = a; e.xclient.format = 32; e.xclient.data.l[0] = value; e.xclient.data.l[1] = CurrentTime; XSendEvent(dpy, w, False, NoEventMask, &e); XSync(dpy, False); } void quit(Arg *arg) { readin = running = False; } /* * There's no way to check accesses to destroyed windows, thus those cases are * ignored (especially on UnmapNotify's). Other types of errors call Xlibs * default error handler, which calls exit(). */ int xerror(Display *dpy, XErrorEvent *ee) { if(ee->error_code == BadWindow || (ee->request_code == X_SetInputFocus && ee->error_code == BadMatch) || (ee->request_code == X_PolyText8 && ee->error_code == BadDrawable) || (ee->request_code == X_PolyFillRectangle && ee->error_code == BadDrawable) || (ee->request_code == X_PolySegment && ee->error_code == BadDrawable) || (ee->request_code == X_ConfigureWindow && ee->error_code == BadMatch) || (ee->request_code == X_GrabKey && ee->error_code == BadAccess)) return 0; fprintf(stderr, "dwm: fatal error: request code=%d, error code=%d\n", ee->request_code, ee->error_code); return xerrorxlib(dpy, ee); /* may call exit() */ } int main(int argc, char *argv[]) { int r, xfd; fd_set rd; if(argc == 2 && !strncmp("-v", argv[1], 3)) { fputs("dwm-"VERSION", (C)opyright MMVI Anselm R. Garbe\n", stdout); exit(EXIT_SUCCESS); } else if(argc != 1) eprint("usage: dwm [-v]\n"); dpy = XOpenDisplay(0); if(!dpy) eprint("dwm: cannot open display\n"); xfd = ConnectionNumber(dpy); screen = DefaultScreen(dpy); root = RootWindow(dpy, screen); otherwm = False; XSetErrorHandler(xerrorstart); /* this causes an error if some other window manager is running */ XSelectInput(dpy, root, SubstructureRedirectMask); XSync(dpy, False); if(otherwm) eprint("dwm: another window manager is already running\n"); XSync(dpy, False); XSetErrorHandler(NULL); xerrorxlib = XSetErrorHandler(xerror); XSync(dpy, False); setup(); drawstatus(); scan(); /* main event loop, also reads status text from stdin */ XSync(dpy, False); procevent(); readin = True; while(running) { FD_ZERO(&rd); if(readin) FD_SET(STDIN_FILENO, &rd); FD_SET(xfd, &rd); r = select(xfd + 1, &rd, NULL, NULL, NULL); if((r == -1) && (errno == EINTR)) continue; if(r > 0) { if(readin && FD_ISSET(STDIN_FILENO, &rd)) { readin = NULL != fgets(stext, sizeof(stext), stdin); if(readin) stext[strlen(stext) - 1] = 0; else strcpy(stext, "broken pipe"); drawstatus(); } } else if(r < 0) eprint("select failed\n"); procevent(); } cleanup(); XCloseDisplay(dpy); return 0; } |