about summary refs log tree commit diff stats
path: root/client.c
Commit message (Expand)AuthorAgeFilesLines
...
* applied offscreen appearance hotfixAnselm R. Garbe2007-01-241-8/+8
* renamed activescreen into selscreen 3.2Anselm R. Garbe2007-01-231-1/+1
* implemented Sanders remarksAnselm R. Garbe2007-01-231-1/+2
* small changesAnselm R. Garbe2007-01-231-4/+6
* removed a blank lineAnselm R. Garbe2007-01-231-1/+0
* this version should also work with cornercases (like unmanage during !issel, ...Anselm R. Garbe2007-01-231-7/+7
* I think this is the best solution of multihead supportAnselm R. Garbe2007-01-231-10/+6
* this variant is known to work, but focus() is ugly - we need in general a bet...Anselm R. Garbe2007-01-221-8/+12
* applied Sanders all5.patch (thanks for your weekend session, Sander!)Anselm R. Garbe2007-01-221-35/+33
* removed drawclient and drawall (they performed useless operations/consumed us...Anselm R. Garbe2007-01-151-2/+3
* removed client title barAnselm R. Garbe2007-01-141-46/+4
* renamed drawtitle into drawclientAnselm R. Garbe2007-01-041-2/+2
* correctionsarg@mig292007-01-021-1/+1
* next version will contain updated copyright noticearg@mig292007-01-021-1/+1
* renamed updatesize into updatesizehints (thx to Sander for this hint)arg@mig292007-01-011-2/+2
* removed Client->gravarg@mig292006-12-121-4/+0
* removed gravitate for the momentarg@mig292006-12-111-54/+1
* disabling configure() during resizearg@mig292006-12-111-1/+1
* made gravitate effectless, waiting for complains ;)arg@mig292006-12-111-0/+1
* applied Jukka's sizeof K&R compliance patch, applied Manuels' last-line print...arg@mig292006-11-261-2/+2
* and another fixarg@mig292006-10-271-2/+2
* applied sanders try2 patcharg@mig292006-10-271-3/+3
* applied sanders max size fixarg@mig292006-10-271-1/+1
* reverting to originalarg@mig292006-10-261-1/+1
* some other changearg@mig292006-10-261-3/+3
* apply small fix to prevent apps like mplayer wandering when toggling fullscreenarg@mig292006-10-261-2/+2
* do* has no Arg arument anymore (never called directly) 1.9Anselm R. Garbe2006-10-061-2/+2
* code polishing, removed unnecessary newlinesAnselm R. Garbe2006-10-061-17/+1
* applied ality's hardcode-0 patchesAnselm R. Garbe2006-09-291-5/+5
* applied Jukkas patchAnselm R. Garbe2006-09-281-6/+6
* fixing the settags issue, preparing 1.7.1 1.7.1Anselm R. Garbe2006-09-271-15/+15
* added configure(), but this doesn't really fix those frking broken SDL appsarg@mmvi2006-09-261-0/+18
* fixed issue pointed out by Jukkaarg@mmvi2006-09-221-4/+0
* implemented the maximization as I described on the mailinglist, this feels be...arg@mmvi2006-09-221-37/+4
* reviewed client.carg@mmvi2006-09-201-0/+1
* offscreen client appearance fixesarg@mmvi2006-09-151-0/+10
* focus() enforces visibility of a client if not NULLarg@mmvi2006-09-151-1/+1
* removed a bunch of lines through making function signatures more consistent w...Anselm R. Garbe2006-09-121-34/+16
* small change to comments, renamed two set* functions in client.c into update*Anselm R. Garbe2006-09-111-4/+4
* added some commentsAnselm R. Garbe2006-09-111-3/+3
* applied sanders patch of not manipulating sel 1.5Anselm R. Garbe2006-09-081-2/+4
* hotfixAnselm R. Garbe2006-09-071-1/+1
* simplified unmanageAnselm R. Garbe2006-09-071-8/+2
* using a global stack for focus recovery on arrange() - seems to work greatAnselm R. Garbe2006-09-071-2/+14
* no this is betterAnselm R. Garbe2006-09-061-7/+0
* does this preserve z order for anthony?Anselm R. Garbe2006-09-061-2/+7
* maybe this might workAnselm R. Garbe2006-09-061-0/+2
* sanders solution is convincing and elegantAnselm R. Garbe2006-09-061-8/+0
* seems to preserve floating client z-layer order (even with reorder() calls)Anselm R. Garbe2006-09-061-0/+8
* moved transient_for tag inheritance to settagsAnselm R. Garbe2006-09-061-6/+2
an>, &r, 1); if(!text) return; w = 0; olen = len = strlen(text); if(len >= sizeof buf) len = sizeof buf - 1; memcpy(buf, text, len); buf[len] = 0; h = dc.font.ascent + dc.font.descent; y = dc.y + (dc.h / 2) - (h / 2) + dc.font.ascent; x = dc.x + (h / 2); /* shorten text if necessary */ while(len && (w = textnw(buf, len)) > dc.w - h) buf[--len] = 0; if(len < olen) { if(len > 1) buf[len - 1] = '.'; if(len > 2) buf[len - 2] = '.'; if(len > 3) buf[len - 3] = '.'; } if(w > dc.w) return; /* too long */ gcv.foreground = col[ColFG]; if(dc.font.set) { XChangeGC(dpy, dc.gc, GCForeground, &gcv); XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len); } else { gcv.font = dc.font.xfont->fid; XChangeGC(dpy, dc.gc, GCForeground | GCFont, &gcv); XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len); } x = (h + 2) / 4; if(filledsquare) { r.x = dc.x + 1; r.y = dc.y + 1; r.width = r.height = x + 1; XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); } else if(emptysquare) { pt[0].x = dc.x + 1; pt[0].y = dc.y + 1; pt[1].x = x; pt[1].y = 0; pt[2].x = 0; pt[2].y = x; pt[3].x = -x; pt[3].y = 0; pt[4].x = 0; pt[4].y = -x; XDrawLines(dpy, dc.drawable, dc.gc, pt, 5, CoordModePrevious); } } /* extern */ void drawall(void) { Client *c; for(c = clients; c; c = getnext(c->next)) drawclient(c); drawstatus(); } void drawstatus(void) { int i, x; dc.x = dc.y = 0; for(i = 0; i < ntags; i++) { dc.w = textw(tags[i]); if(seltag[i]) drawtext(tags[i], dc.sel, sel && sel->tags[i], isoccupied(i)); else drawtext(tags[i], dc.norm, sel && sel->tags[i], isoccupied(i)); dc.x += dc.w; } dc.w = bmw; drawtext(arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, dc.status, False, False); x = dc.x + dc.w; dc.w = textw(stext); dc.x = bw - dc.w; if(dc.x < x) { dc.x = x; dc.w = bw - x; } drawtext(stext, dc.status, False, False); if((dc.w = dc.x - x) > bh) { dc.x = x; drawtext(sel ? sel->name : NULL, sel ? dc.sel : dc.norm, False, False); } XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0); XSync(dpy, False); } void drawclient(Client *c) { if(c == sel && issel) { drawstatus(); XSetWindowBorder(dpy, c->win, dc.sel[ColBG]); return; } XSetWindowBorder(dpy, c->win, dc.norm[ColBG]); XSync(dpy, False); } unsigned long getcolor(const char *colstr) { Colormap cmap = DefaultColormap(dpy, screen); XColor color; if(!XAllocNamedColor(dpy, cmap, colstr, &color, &color)) eprint("error, cannot allocate color '%s'\n", colstr); return color.pixel; } void setfont(const char *fontstr) { char *def, **missing; int i, n; missing = NULL; if(dc.font.set) XFreeFontSet(dpy, dc.font.set); dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def); if(missing) { while(n--) fprintf(stderr, "missing fontset: %s\n", missing[n]); XFreeStringList(missing); } if(dc.font.set) { XFontSetExtents *font_extents; XFontStruct **xfonts; char **font_names; dc.font.ascent = dc.font.descent = 0; font_extents = XExtentsOfFontSet(dc.font.set); n = XFontsOfFontSet(dc.font.set, &xfonts, &font_names); for(i = 0, dc.font.ascent = 0, dc.font.descent = 0; i < n; i++) { if(dc.font.ascent < (*xfonts)->ascent) dc.font.ascent = (*xfonts)->ascent; if(dc.font.descent < (*xfonts)->descent) dc.font.descent = (*xfonts)->descent; xfonts++; } } else { if(dc.font.xfont) XFreeFont(dpy, dc.font.xfont); dc.font.xfont = NULL; if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr))) eprint("error, cannot load font: '%s'\n", fontstr); dc.font.ascent = dc.font.xfont->ascent; dc.font.descent = dc.font.xfont->descent; } dc.font.height = dc.font.ascent + dc.font.descent; } unsigned int textw(const char *text) { return textnw(text, strlen(text)) + dc.font.height; }