about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* removed two spaces reported by SoleenAnselm R. Garbe2007-10-031-2/+2
|
* reverted Peters patch to tile, I will discuss the reasons at dwm@Anselm R. Garbe2007-10-011-6/+3
|
* s/xterm/uxterm/Anselm R. Garbe2007-10-011-1/+1
|
* added hint for downloading dextraAnselm R. Garbe2007-10-011-0/+3
|
* fixed font definitionAnselm R. Garbe2007-10-011-1/+1
|
* fixed man pageAnselm R. Garbe2007-09-301-1/+1
|
* fixed an issue in Peter's patch (it is no good idea to restack() all clients ↵Anselm R. Garbe2007-09-301-1/+2
| | | | on enternotify()
* applied Peter Hartlich's border collapse patchAnselm R. Garbe2007-09-302-10/+12
|
* improved tile() for the RESIZEHINTS == True case, now more space is consumed ↵Anselm R. Garbe2007-09-271-5/+6
| | | | by the clients (esp. if those clients use increment handling heavily)
* fixed colorsAnselm R. Garbe2007-09-271-3/+3
|
* fixed inclusion orderarg@suckless.org2007-09-271-1/+2
|
* updated with my favorite colorschemeAnselm R. Garbe2007-09-261-7/+6
|
* applied colors depend from lavishs proposalAnselm R. Garbe2007-09-251-6/+6
|
* switching to white normal bg, renaming tag 9 into www, for static use in ↵Anselm R. Garbe2007-09-231-9/+9
| | | | conjunction with ff
* btw 4.6 will be the next releaseAnselm R. Garbe2007-09-231-1/+1
|
* renamed config.h into config.def.h, config.h will be created if not present, ↵Anselm R. Garbe2007-09-232-1/+5
| | | | this seems less annoying after all
* introduced ISTILE, which can be easily extended with other layout functions ↵Anselm R. Garbe2007-09-222-6/+7
| | | | to allow reuse of setmwfact() and zoom()
* setmwfact and zoom check isarrange(floating) now, not !isarrange(tile) - ↵Anselm R. Garbe2007-09-221-2/+2
| | | | this makes it easier to play well with bstack and nmtile patches
* Added tag 4.5 for changeset 2acc60d6dfe2Anselm R. Garbe2007-09-221-0/+1
|
* cosmetic fix 4.5Anselm R. Garbe2007-09-221-1/+2
|
* fixed a commentAnselm R. Garbe2007-09-201-1/+1
|
* applied Peters patch, applied yiyus hint to initfontarg@suckless.org2007-09-191-12/+12
|
* applied Peter Hartlich's togglemax patch to allow toggling tiled clients to ↵Anselm R. Garbe2007-09-182-4/+13
| | | | maximum
* made all stuff non-static - so you can choose wether to use dwm the static ↵arg@suckless.org2007-09-174-187/+184
| | | | or the extern way when extending it
* there might be envs which need Xlib.hAnselm R. Garbe2007-09-161-0/+1
|
* Mod1-Button2 on a floating but not-fixed client will make it tiled againAnselm R. Garbe2007-09-162-3/+7
|
* now tiled windows can be resized/moved, their floating state will be toggled ↵Anselm R. Garbe2007-09-162-8/+12
| | | | implicitely
* some more rearrangementsAnselm R. Garbe2007-09-161-147/+143
|
* ordered all functions alphabeticallyAnselm R. Garbe2007-09-161-1025/+1023
|
* corrected a misleading commentAnselm R. Garbe2007-09-161-1/+1
|
* macros which have been defined in config.h can only be used at function ↵Anselm R. Garbe2007-09-161-6/+10
| | | | level, however you can nest code into config.h now for implementing a different layout (just for example), eg. #include "supertile.c"
* ordered function forward definitionsAnselm R. Garbe2007-09-151-56/+57
|
* backporting my intro-comment of old dwm.hAnselm R. Garbe2007-09-151-1/+30
|
* removed grabkeys, not necessaryAnselm R. Garbe2007-09-151-26/+21
|
* micromizing dwm step 1Anselm R. Garbe2007-09-1513-1971/+1861
|
* new colorscheme (16-bit compliant)Anselm R. Garbe2007-09-154-15/+14
|
* moved bar-related stuff to bar.c (merged draw.c into that)Anselm R. Garbe2007-09-156-259/+269
|
* renamed drawstatus into drawbarAnselm R. Garbe2007-09-156-10/+10
|
* renamed config.default.h into config.hAnselm R. Garbe2007-09-152-6/+2
|
* dist target only needs to add config.default.hAnselm R. Garbe2007-09-151-1/+1
|
* removed config.arg.h, only 1 config.h necessaryAnselm R. Garbe2007-09-152-112/+22
|
* small changes of the colorsAnselm R. Garbe2007-09-141-7/+10
|
* other colorAnselm R. Garbe2007-09-111-3/+3
|
* using light colorscheme, preparing merge of config.arg.h with config.default.hAnselm R. Garbe2007-09-111-7/+7
|
* I work with enabled RESIZEHINTS, simply because I force myself to continue ↵Anselm R. Garbe2007-09-091-1/+1
| | | | the st development ;)
* introduced new define RESIZEHINTS, which allows to enable/disable size hint ↵Anselm R. Garbe2007-09-094-2/+4
| | | | handling in tiled resizals
* 14px fonts drives me nutsAnselm R. Garbe2007-09-071-1/+1
|
* Added tag 4.4.1 for changeset 7c117df5d202Anselm R. Garbe2007-08-261-0/+1
|
* prepared 4.4.1 bugfix and minor feature enhancement release 4.4.1Anselm R. Garbe2007-08-265-5/+5
|
* Added tag 4.4 for changeset 408014d21261Anselm R. Garbe2007-08-231-0/+1
|
c->win, c->x + 2 * sw, c->y); XMoveWindow(dpy, c->title, c->tx + 2 * sw, c->ty); } void focus(Client *c) { Client *old = sel; XEvent ev; sel = c; if(old && old != c) drawtitle(old); drawtitle(c); XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); XSync(dpy, False); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); } void focusnext(Arg *arg) { Client *c; if(!sel) return; if(sel->ismax) togglemax(NULL); if(!(c = getnext(sel->next))) c = getnext(clients); if(c) { higher(c); focus(c); } } void focusprev(Arg *arg) { Client *c; if(!sel) return; if(sel->ismax) togglemax(NULL); if(!(c = getprev(sel->prev))) { for(c = clients; c && c->next; c = c->next); c = getprev(c); } if(c) { higher(c); focus(c); } } Client * getclient(Window w) { Client *c; for(c = clients; c; c = c->next) if(c->win == w) return c; return NULL; } Client * getctitle(Window w) { Client *c; for(c = clients; c; c = c->next) if(c->title == w) return c; return NULL; } void gravitate(Client *c, Bool invert) { int dx = 0, dy = 0; switch(c->grav) { default: break; case StaticGravity: case NorthWestGravity: case NorthGravity: case NorthEastGravity: dy = c->border; break; case EastGravity: case CenterGravity: case WestGravity: dy = -(c->h / 2) + c->border; break; case SouthEastGravity: case SouthGravity: case SouthWestGravity: dy = -(c->h); break; } switch (c->grav) { default: break; case StaticGravity: case NorthWestGravity: case WestGravity: case SouthWestGravity: dx = c->border; break; case NorthGravity: case CenterGravity: case SouthGravity: dx = -(c->w / 2) + c->border; break; case NorthEastGravity: case EastGravity: case SouthEastGravity: dx = -(c->w + c->border); break; } if(invert) { dx = -dx; dy = -dy; } c->x += dx; c->y += dy; } void higher(Client *c) { XRaiseWindow(dpy, c->win); XRaiseWindow(dpy, c->title); } void killclient(Arg *arg) { if(!sel) return; if(sel->proto & PROTODELWIN) sendevent(sel->win, wmatom[WMProtocols], wmatom[WMDelete]); else XKillClient(dpy, sel->win); } void lower(Client *c) { XLowerWindow(dpy, c->title); XLowerWindow(dpy, c->win); } void manage(Window w, XWindowAttributes *wa) { Client *c; Window trans; XSetWindowAttributes twa; c = emallocz(sizeof(Client)); c->tags = emallocz(ntags * sizeof(Bool)); c->win = w; c->x = c->tx = wa->x; c->y = c->ty = wa->y; c->w = c->tw = wa->width; c->h = wa->height; c->th = bh; c->border = 0; setsize(c); if(c->h != sh && c->y < bh) c->y = c->ty = bh; c->proto = getproto(c->win); XSelectInput(dpy, c->win, StructureNotifyMask | PropertyChangeMask | EnterWindowMask); XGetTransientForHint(dpy, c->win, &trans); twa.override_redirect = 1; twa.background_pixmap = ParentRelative; twa.event_mask = ExposureMask | EnterWindowMask; c->title = XCreateWindow(dpy, root, c->tx, c->ty, c->tw, c->th, 0, DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa); if(clients) clients->prev = c; c->next = clients; clients = c; XGrabButton(dpy, Button1, MODKEY, c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button1, MODKEY | LockMask, c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button1, MODKEY | NUMLOCKMASK, c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button1, MODKEY | NUMLOCKMASK | LockMask, c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button2, MODKEY, c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button2, MODKEY | LockMask, c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button2, MODKEY | NUMLOCKMASK, c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button2, MODKEY | NUMLOCKMASK | LockMask, c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button3, MODKEY, c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button3, MODKEY | LockMask, c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button3, MODKEY | NUMLOCKMASK, c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button3, MODKEY | NUMLOCKMASK | LockMask, c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); settags(c); if(!c->isfloat) c->isfloat = trans || (c->maxw && c->minw && c->maxw == c->minw && c->maxh == c->minh); settitle(c); arrange(NULL); /* mapping the window now prevents flicker */ XMapRaised(dpy, c->win); XMapRaised(dpy, c->title); if(c->tags[tsel]) focus(c); } void resize(Client *c, Bool sizehints, Corner sticky) { int bottom = c->y + c->h; int right = c->x + c->w; /*XConfigureEvent e;*/ XWindowChanges wc; if(sizehints) { if(c->incw) c->w -= (c->w - c->basew) % c->incw; if(c->inch) c->h -= (c->h - c->baseh) % c->inch; if(c->minw && c->w < c->minw) c->w = c->minw; if(c->minh && c->h < c->minh) c->h = c->minh; if(c->maxw && c->w > c->maxw) c->w = c->maxw; if(c->maxh && c->h > c->maxh) c->h = c->maxh; } if(c->x > right) /* might happen on restart */ c->x = right - c->w; if(c->y > bottom) c->y = bottom - c->h; if(sticky == TopRight || sticky == BotRight) c->x = right - c->w; if(sticky == BotLeft || sticky == BotRight) c->y = bottom - c->h; resizetitle(c); wc.x = c->x; wc.y = c->y; wc.width = c->w; wc.height = c->h; if(c->w == sw && c->h == sh) wc.border_width = 0; else wc.border_width = 1; XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); XSync(dpy, False); } void setsize(Client *c) { long msize; XSizeHints size; if(!XGetWMNormalHints(dpy, c->win, &size, &msize) || !size.flags) size.flags = PSize; c->flags = size.flags; if(c->flags & PBaseSize) { c->basew = size.base_width; c->baseh = size.base_height; } else c->basew = c->baseh = 0; if(c->flags & PResizeInc) { c->incw = size.width_inc; c->inch = size.height_inc; } else c->incw = c->inch = 0; if(c->flags & PMaxSize) { c->maxw = size.max_width; c->maxh = size.max_height; } else c->maxw = c->maxh = 0; if(c->flags & PMinSize) { c->minw = size.min_width; c->minh = size.min_height; } else c->minw = c->minh = 0; if(c->flags & PWinGravity) c->grav = size.win_gravity; else c->grav = NorthWestGravity; } void settitle(Client *c) { char **list = NULL; int n; XTextProperty name; name.nitems = 0; c->name[0] = 0; XGetTextProperty(dpy, c->win, &name, netatom[NetWMName]); if(!name.nitems) XGetWMName(dpy, c->win, &name); if(!name.nitems) return; if(name.encoding == XA_STRING) strncpy(c->name, (char *)name.value, sizeof(c->name)); else { if(XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success && n > 0 && *list) { strncpy(c->name, *list, sizeof(c->name)); XFreeStringList(list); } } XFree(name.value); resizetitle(c); } void togglemax(Arg *arg) { int ox, oy, ow, oh; XEvent ev; if(!sel) return; if((sel->ismax = !sel->ismax)) { ox = sel->x; oy = sel->y; ow = sel->w; oh = sel->h; sel->x = sx; sel->y = sy + bh; sel->w = sw - 2; sel->h = sh - 2 - bh; higher(sel); resize(sel, False, TopLeft); sel->x = ox; sel->y = oy; sel->w = ow; sel->h = oh; } else resize(sel, False, TopLeft); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); } void unmanage(Client *c) { XGrabServer(dpy); XSetErrorHandler(xerrordummy); XUngrabButton(dpy, AnyButton, AnyModifier, c->win); XDestroyWindow(dpy, c->title); if(c->prev) c->prev->next = c->next; if(c->next) c->next->prev = c->prev; if(c == clients) clients = c->next; if(sel == c) { sel = getnext(c->next); if(!sel) sel = getprev(c->prev); if(!sel) sel = clients; } free(c->tags); free(c); XSync(dpy, False); XSetErrorHandler(xerror); XUngrabServer(dpy); arrange(NULL); if(sel) focus(sel); } void zoom(Arg *arg) { Client *c; if(!sel || (arrange != dotile) || sel->isfloat) return; if(sel == getnext(clients)) { if((c = getnext(sel->next))) sel = c; else return; } /* pop */ if(sel->prev) sel->prev->next = sel->next; if(sel->next) sel->next->prev = sel->prev; sel->prev = NULL; if(clients) clients->prev = sel; sel->next = clients; clients = sel; arrange(NULL); focus(sel); }