about summary refs log tree commit diff stats
path: root/dwm.h
Commit message (Collapse)AuthorAgeFilesLines
* moved MOUSEMASK into event.c (not used in other places)Anselm R. Garbe2006-10-161-1/+0
|
* do* has no Arg arument anymore (never called directly) 1.9Anselm R. Garbe2006-10-061-3/+3
|
* code polishing, removed unnecessary newlinesAnselm R. Garbe2006-10-061-2/+1
|
* removed the stack position stuffAnselm R. Garbe2006-10-051-6/+0
|
* keep master ratio on resizecol -> arrangeAnselm R. Garbe2006-10-051-3/+3
|
* simplified dotile()Anselm R. Garbe2006-10-051-1/+0
|
* removed useless updatemasterAnselm R. Garbe2006-09-291-1/+0
|
* removed the direction flippingAnselm R. Garbe2006-09-291-2/+0
|
* added the new dotile as described on mlAnselm R. Garbe2006-09-291-3/+6
|
* prelim of dotile()Anselm R. Garbe2006-09-291-0/+1
|
* first step to a more flexible dotile() algorithmAnselm R. Garbe2006-09-291-1/+7
|
* applied Jukkas patchAnselm R. Garbe2006-09-281-0/+2
|
* fixing the settags issue, preparing 1.7.1 1.7.1Anselm R. Garbe2006-09-271-0/+1
|
* added configure(), but this doesn't really fix those frking broken SDL appsarg@mmvi2006-09-261-0/+1
|
* applied sanders jukka patcharg@mmvi2006-09-251-1/+1
|
* applied Jukkas patcharg@mmvi2006-09-251-6/+6
|
* small change to achieve Jukka's last proposalarg@mmvi2006-09-221-1/+2
|
* fixed issue pointed out by Jukkaarg@mmvi2006-09-221-1/+0
|
* implemented the maximization as I described on the mailinglist, this feels ↵arg@mmvi2006-09-221-2/+2
| | | | better to me.
* improved intro comment in dwm.h, updated config.mkarg@mmvi2006-09-201-3/+3
|
* some simplifications to intro in dwm.harg@mmvi2006-09-191-13/+13
|
* some more simplifications of intro comment in dwm.h, this should suffice for ↵Anselm R. Garbe2006-09-121-20/+14
| | | | comments in dwm
* made introduction comment in dwm.h shorterAnselm R. Garbe2006-09-121-20/+15
|
* added a general comment to dwm.h how dwm is basically organizedAnselm R. Garbe2006-09-121-0/+40
|
* some other simplificationsAnselm R. Garbe2006-09-111-11/+11
|
* small change to comments, renamed two set* functions in client.c into update*Anselm R. Garbe2006-09-111-11/+11
|
* small fixAnselm R. Garbe2006-09-111-2/+2
|
* added some commentsAnselm R. Garbe2006-09-111-72/+69
|
* using a global stack for focus recovery on arrange() - seems to work greatAnselm R. Garbe2006-09-071-1/+2
|
* moved transient_for tag inheritance to settagsAnselm R. Garbe2006-09-061-1/+1
|
* renamed resizetile into resizecolAnselm R. Garbe2006-09-051-1/+1
|
* s/growcol/resizetile/gAnselm R. Garbe2006-09-051-1/+1
|
* I really need column growing, now pushing upstreamAnselm R. Garbe2006-09-051-0/+1
|
* applied Sanders max_and_focus.patchAnselm R. Garbe2006-09-041-2/+1
|
* added viewall to mainstream (only Ross Mohns version, not the toggle)Anselm R. Garbe2006-08-311-0/+1
|
* still something wrong with reorder()Anselm R. Garbe2006-08-291-2/+1
|
* added attach/detach functions which don't attach at the begin of list, but ↵Anselm R. Garbe2006-08-291-0/+2
| | | | at the slot of a first match of the tags of a client
* trying a different configurationAnselm R. Garbe2006-08-251-2/+2
|
* new color stuff/new rendering stuffAnselm R. Garbe2006-08-251-4/+7
|
* back to 3 colorsAnselm R. Garbe2006-08-251-2/+3
|
* 3->4 colorsAnselm R. Garbe2006-08-241-3/+2
|
* updated man pageAnselm R. Garbe2006-08-231-1/+1
|
* separated setup stuff into main.c:setup() - this makes main() more readableAnselm R. Garbe2006-08-231-12/+8
|
* separated several functions into view.cAnselm R. Garbe2006-08-221-10/+12
|
* changed main event loopAnselm R.Garbe2006-08-151-0/+1
|
* removed NUMLOCKMASK, added dynamically calculated numlockmask insteadAnselm R.Garbe2006-08-141-1/+1
|
* changed replacetag into toggletagAnselm R.Garbe2006-08-141-3/+3
|
* removed ungrabkeys again (because of sander's mail)Anselm R.Garbe2006-08-141-1/+0
|
* implemented ungrabkeys() which is called in cleanup()Anselm R.Garbe2006-08-141-0/+1
|
* implemented restack behavior (floats are on top in tiled mode)Anselm R.Garbe2006-08-141-1/+2
|
n>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.bg[0] = getcolor(NORMBGCOLOR); dc.fg[0] = getcolor(NORMFGCOLOR); dc.bg[1] = getcolor(SELBGCOLOR); dc.fg[1] = getcolor(SELFGCOLOR); setfont(FONT); 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 + 4; 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; }