summary refs log tree commit diff
path: root/grab.c
diff options
context:
space:
mode:
authoroga <oga>2008-06-15 02:47:46 +0000
committeroga <oga>2008-06-15 02:47:46 +0000
commit07cd0b1ac55f819f42b2936339843bb85e7630bb (patch)
tree0e40db1dce753062bb6d979553e426b18cb71269 /grab.c
parent96d7310b4a224d50aeb2e5e94031d14b9bd6daf5 (diff)
downloadcwm-07cd0b1ac55f819f42b2936339843bb85e7630bb.tar.gz
cwm-07cd0b1ac55f819f42b2936339843bb85e7630bb.tar.xz
cwm-07cd0b1ac55f819f42b2936339843bb85e7630bb.zip
Rip out and burn the HASH_* stuff. We don't need a SPLAY tree for one font.
makes the code a lot simpler. While here rearrange the font handling functions
to be less shit.

ok and help okan@.
Diffstat (limited to 'grab.c')
-rw-r--r--grab.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/grab.c b/grab.c
index 9e29b3c..9cc1ec6 100644
--- a/grab.c
+++ b/grab.c
@@ -33,23 +33,22 @@ grab_sweep_draw(struct client_ctx *cc, int dx, int dy)
 	int x0 = cc->geom.x, y0 = cc->geom.y;
 	char asize[10];	/* fits "nnnnxnnnn\0" */
 	int wide, height, wide_size, wide_name;
-	struct fontdesc *font = DefaultFont;
 
 	snprintf(asize, sizeof(asize), "%dx%d",
 	    ADJUST_WIDTH(cc, dx), ADJUST_HEIGHT(cc, dy));
-	wide_size = font_width(font, asize, strlen(asize)) + 4;
-	wide_name = font_width(font, cc->name, strlen(cc->name)) + 4;
+	wide_size = font_width(asize, strlen(asize)) + 4;
+	wide_name = font_width(cc->name, strlen(cc->name)) + 4;
 	wide = MAX(wide_size, wide_name);
-	height = font_ascent(font) + font_descent(font) + 1;
+	height = font_ascent() + font_descent() + 1;
 
 	XMoveResizeWindow(X_Dpy, sc->menuwin, x0, y0, wide, height * 2);
 	XMapWindow(X_Dpy, sc->menuwin);
 	XReparentWindow(X_Dpy, sc->menuwin, cc->win, 0, 0);
 	XClearWindow(X_Dpy, sc->menuwin);
-	font_draw(font, cc->name, strlen(cc->name), sc->menuwin,
-	    2, font_ascent(font) + 1);
-	font_draw(font, asize, strlen(asize), sc->menuwin,
-	    wide/2 - wide_size/2, height + font_ascent(font) + 1);
+	font_draw(sc, cc->name, strlen(cc->name), sc->menuwin,
+	    2, font_ascent() + 1);
+	font_draw(sc, asize, strlen(asize), sc->menuwin,
+	    wide/2 - wide_size/2, height + font_ascent() + 1);
 }
 
 void