[hackers] [dwm] checking result of XGetClassHint, removed some obsolete lines in initfont() || Anselm R Garbe

From: <hg_AT_suckless.org>
Date: Fri, 29 Aug 2008 09:13:54 +0000 (UTC)

changeset: 1348:18098673e417
branch: merge
tag: tip
user: Anselm R Garbe <garbeam_AT_gmail.com>
date: Fri Aug 29 10:13:47 2008 +0100
files: dwm.c
description:
checking result of XGetClassHint, removed some obsolete lines in initfont()

diff -r 87771e5f517f -r 18098673e417 dwm.c
--- a/dwm.c Wed Aug 27 15:03:35 2008 +0100
+++ b/dwm.c Fri Aug 29 10:13:47 2008 +0100
@@ -233,7 +233,7 @@
 static Client *stack = NULL;
 static Cursor cursor[CurLast];
 static Display *dpy;
-static DC dc = {0};
+static DC dc;
 static Layout *lt[] = { NULL, NULL };
 static Window root, barwin;
 /* configuration, allows nested code to access above variables */
@@ -250,7 +250,8 @@
         XClassHint ch = { 0 };
 
         /* rule matching */
- XGetClassHint(dpy, c->win, &ch);
+ if(XGetClassHint(dpy, c->win, &ch) == 0)
+ return;
         for(i = 0; i < LENGTH(rules); i++) {
                 r = &rules[i];
                 if((!r->title || strstr(c->name, r->title))
@@ -796,9 +797,6 @@
                 }
         }
         else {
- if(dc.font.xfont)
- XFreeFont(dpy, dc.font.xfont);
- dc.font.xfont = NULL;
                 if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr))
                 && !(dc.font.xfont = XLoadQueryFont(dpy, "fixed")))
                         die("error, cannot load font: '%s'\n", fontstr);
Received on Fri Aug 29 2008 - 09:13:54 UTC

This archive was generated by hypermail 2.2.0 : Fri Aug 29 2008 - 09:24:08 UTC