X-Git-Url: https://git.xinqibao.xyz/dwm.git/blobdiff_plain/4b06155873d8d6b6588c3fc50c92c64a61a863f4..7ac0de8350c51ef39e4dee5f60e1da641c4fbd5b:/draw.c

diff --git a/draw.c b/draw.c
index 2dcafe1..9a469f9 100644
--- a/draw.c
+++ b/draw.c
@@ -1,8 +1,7 @@
-/* (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com>
+/* (C)opyright MMIV-MMVII Anselm R. Garbe <garbeam at gmail dot com>
  * See LICENSE file for license details.
  */
 #include "dwm.h"
-#include <locale.h>
 #include <stdio.h>
 #include <string.h>
 
@@ -103,7 +102,7 @@ drawall(void) {
 	Client *c;
 
 	for(c = clients; c; c = getnext(c->next))
-		drawtitle(c);
+		drawclient(c);
 	drawstatus();
 }
 
@@ -139,7 +138,7 @@ drawstatus(void) {
 }
 
 void
-drawtitle(Client *c) {
+drawclient(Client *c) {
 	if(c == sel && issel) {
 		drawstatus();
 		XUnmapWindow(dpy, c->twin);
@@ -167,16 +166,13 @@ getcolor(const char *colstr) {
 
 void
 setfont(const char *fontstr) {
-	char *def, *lc, **missing;
+	char *def, **missing;
 	int i, n;
 
-	lc = setlocale(LC_CTYPE, NULL);
-	setlocale(LC_CTYPE, "UTF-8");
 	missing = NULL;
 	if(dc.font.set)
 		XFreeFontSet(dpy, dc.font.set);
 	dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def);
-	setlocale(LC_CTYPE, lc);
 	if(missing) {
 		while(n--)
 			fprintf(stderr, "missing fontset: %s\n", missing[n]);
@@ -201,11 +197,8 @@ setfont(const char *fontstr) {
 		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");
+		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;
 	}