summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarg@localhost.localdomain <unknown>2008-09-01 08:22:11 +0000
committerarg@localhost.localdomain <unknown>2008-09-01 08:22:11 +0000
commit815f9c054d1d1fe0c0878f01399561d7758bf1ce (patch)
tree9156704109f2bd2b2e153a95f37b54728cf6daa7
parentintroduced NOBORDER macro to hide the nasty - 2 * c->bw in various calculatio... (diff)
parentfixed (diff)
downloaddwm-815f9c054d1d1fe0c0878f01399561d7758bf1ce.tar.gz
dwm-815f9c054d1d1fe0c0878f01399561d7758bf1ce.zip
merged merge
Diffstat (limited to '')
-rw-r--r--dwm.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/dwm.c b/dwm.c
index 077c61e..2a4bacc 100644
--- a/dwm.c
+++ b/dwm.c
@@ -61,7 +61,7 @@
61enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 61enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
62enum { ColBorder, ColFG, ColBG, ColLast }; /* color */ 62enum { ColBorder, ColFG, ColBG, ColLast }; /* color */
63enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */ 63enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */
64enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */ 64enum { WMProtocols, WMDelete, WMState, WMLast }; /* default atoms */
65enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, 65enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
66 ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ 66 ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
67 67
@@ -233,7 +233,7 @@ static Client *sel = NULL;
233static Client *stack = NULL; 233static Client *stack = NULL;
234static Cursor cursor[CurLast]; 234static Cursor cursor[CurLast];
235static Display *dpy; 235static Display *dpy;
236static DC dc = {0}; 236static DC dc;
237static Layout *lt[] = { NULL, NULL }; 237static Layout *lt[] = { NULL, NULL };
238static Window root, barwin; 238static Window root, barwin;
239/* configuration, allows nested code to access above variables */ 239/* configuration, allows nested code to access above variables */
@@ -250,20 +250,21 @@ applyrules(Client *c) {
250 XClassHint ch = { 0 }; 250 XClassHint ch = { 0 };
251 251
252 /* rule matching */ 252 /* rule matching */
253 XGetClassHint(dpy, c->win, &ch); 253 if(XGetClassHint(dpy, c->win, &ch)) {
254 for(i = 0; i < LENGTH(rules); i++) { 254 for(i = 0; i < LENGTH(rules); i++) {
255 r = &rules[i]; 255 r = &rules[i];
256 if((!r->title || strstr(c->name, r->title)) 256 if((!r->title || strstr(c->name, r->title))
257 && (!r->class || (ch.res_class && strstr(ch.res_class, r->class))) 257 && (!r->class || (ch.res_class && strstr(ch.res_class, r->class)))
258 && (!r->instance || (ch.res_name && strstr(ch.res_name, r->instance)))) { 258 && (!r->instance || (ch.res_name && strstr(ch.res_name, r->instance)))) {
259 c->isfloating = r->isfloating; 259 c->isfloating = r->isfloating;
260 c->tags |= r->tags & TAGMASK; 260 c->tags |= r->tags & TAGMASK;
261 }
261 } 262 }
263 if(ch.res_class)
264 XFree(ch.res_class);
265 if(ch.res_name)
266 XFree(ch.res_name);
262 } 267 }
263 if(ch.res_class)
264 XFree(ch.res_class);
265 if(ch.res_name)
266 XFree(ch.res_name);
267 if(!c->tags) 268 if(!c->tags)
268 c->tags = tagset[seltags]; 269 c->tags = tagset[seltags];
269} 270}
@@ -796,9 +797,6 @@ initfont(const char *fontstr) {
796 } 797 }
797 } 798 }
798 else { 799 else {
799 if(dc.font.xfont)
800 XFreeFont(dpy, dc.font.xfont);
801 dc.font.xfont = NULL;
802 if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr)) 800 if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr))
803 && !(dc.font.xfont = XLoadQueryFont(dpy, "fixed"))) 801 && !(dc.font.xfont = XLoadQueryFont(dpy, "fixed")))
804 die("error, cannot load font: '%s'\n", fontstr); 802 die("error, cannot load font: '%s'\n", fontstr);
@@ -1326,7 +1324,6 @@ setup(void) {
1326 /* init atoms */ 1324 /* init atoms */
1327 wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); 1325 wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
1328 wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); 1326 wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
1329 wmatom[WMName] = XInternAtom(dpy, "WM_NAME", False);
1330 wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); 1327 wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False);
1331 netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); 1328 netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
1332 netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); 1329 netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
@@ -1634,7 +1631,7 @@ updatesizehints(Client *c) {
1634void 1631void
1635updatetitle(Client *c) { 1632updatetitle(Client *c) {
1636 if(!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name)) 1633 if(!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name))
1637 gettextprop(c->win, wmatom[WMName], c->name, sizeof c->name); 1634 gettextprop(c->win, XA_WM_NAME, c->name, sizeof c->name);
1638} 1635}
1639 1636
1640void 1637void