about summary refs log tree commit diff stats
path: root/client.c
Commit message (Expand)AuthorAgeFilesLines
...
* bugfix of transient handlingAnselm R. Garbe2007-02-191-8/+8
* draw.c is useless (belongs to main.c now)Anselm R. Garbe2007-02-191-11/+1
* renamed view.c into screen.cAnselm R. Garbe2007-02-191-13/+60
* renamed manage.c to view.cAnselm R. Garbe2007-02-191-11/+85
* some more refactoringAnselm R. Garbe2007-02-191-42/+0
* added some new convenience functionsAnselm R. Garbe2007-02-191-14/+35
* simplified configurerequest to a bare minimum, removed wrong ban() callsAnselm R. Garbe2007-02-191-8/+0
* removed ugly ban(), extended resize() that it only resets the size if necessa...Anselm R. Garbe2007-02-161-37/+44
* added ban() which takes care than a banned window is not banned again... (thi...Anselm R. Garbe2007-02-141-1/+9
* made for/if/else constructs more consistent, some code polishingAnselm R. Garbe2007-02-141-3/+3
* making it more sure that transient checks will work in any caseAnselm R. Garbe2007-02-131-3/+4
* simplified configurerequestAnselm R. Garbe2007-02-131-12/+13
* replaced getproto with a saner function, now old-school artifacts of WM times...Anselm R. Garbe2007-02-071-2/+16
* yet another fixAnselm R. Garbe2007-02-061-1/+1
* simplificationAnselm R. Garbe2007-02-061-10/+5
* implemented aspect ratio support of windowsAnselm R. Garbe2007-02-061-4/+40
* made some changes more concistentAnselm R. Garbe2007-02-051-2/+2
* handling WM_STATE seems to make DnD in gtk/qt apps working, well let's handle...Anselm R. Garbe2007-01-281-0/+9
* prepared yet another hotfix release 3.2.2Anselm R. Garbe2007-01-251-0/+2
* 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
/span>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); } if(highlight) { r.x = dc.x + 2; r.y = dc.y + 2; r.width = r.height = 3; XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); } } /* extern */ void drawall() { Client *c; for(c = clients; c; c = getnext(c->next)) drawtitle(c); drawstatus(); } void drawstatus() { 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]); else drawtext(tags[i], dc.norm, sel && sel->tags[i]); dc.x += dc.w; } dc.w = bmw; drawtext(arrange == dotile ? TILESYMBOL : FLOATSYMBOL, dc.status, False); x = dc.x + dc.w; dc.w = textw(stext); dc.x = bx + bw - dc.w; if(dc.x < x) { dc.x = x; dc.w = bw - x; } drawtext(stext, dc.status, False); if((dc.w = dc.x - x) > bh) { dc.x = x; if(sel) drawtext(sel->name, dc.sel, False); else drawtext(NULL, dc.norm, False); } XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0); XSync(dpy, False); } void drawtitle(Client *c) { if(c == sel && issel) { drawstatus(); XUnmapWindow(dpy, c->twin); XSetWindowBorder(dpy, c->win, dc.sel[ColBG]); return; } XSetWindowBorder(dpy, c->win, dc.norm[ColBG]); XMapWindow(dpy, c->twin); dc.x = dc.y = 0; dc.w = c->tw; drawtext(c->name, dc.norm, False); XCopyArea(dpy, dc.drawable, c->twin, dc.gc, 0, 0, c->tw, c->th, 0, 0); XSync(dpy, False); } unsigned long getcolor(const char *colstr) { Colormap cmap = DefaultColormap(dpy, screen); XColor color; XAllocNamedColor(dpy, cmap, colstr, &color, &color); return color.pixel; } void setfont(const char *fontstr) { char **missing, *def; int i, n; missing = NULL; setlocale(LC_ALL, ""); 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) { XFreeFontSet(dpy, dc.font.set); dc.font.set = NULL; } } 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; dc.font.xfont = XLoadQueryFont(dpy, fontstr); if (!dc.font.xfont) dc.font.xfont = XLoadQueryFont(dpy, "fixed"); if (!dc.font.xfont) eprint("error, cannot init 'fixed' font\n"); 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; }