[hackers] [dwm] applied Peters patch, applied yiyus hint to initfont

From: <arg_AT_suckless.org>
Date: Wed Sep 19 17:35:14 2007

changeset: 1003:19d4ccea9745
tag: tip
user: arg_AT_suckless.org
date: Wed Sep 19 17:32:28 2007 +0200
summary: applied Peters patch, applied yiyus hint to initfont

diff -r 5cc2be8efeb4 -r 19d4ccea9745 dwm.c
--- a/dwm.c Tue Sep 18 19:04:50 2007 +0200
+++ b/dwm.c Wed Sep 19 17:32:28 2007 +0200
@@ -334,10 +334,10 @@ buttonpress(XEvent *e) {
                 if(CLEANMASK(ev->state) != MODKEY)
                         return;
                 if(ev->button == Button1) {
- if(!isarrange(floating) && !c->isfloating)
+ if(isarrange(floating) || c->isfloating)
+ restack();
+ else
                                 togglefloating(NULL);
- else
- restack();
                         movemouse(c);
                 }
                 else if(ev->button == Button2) {
@@ -347,10 +347,10 @@ buttonpress(XEvent *e) {
                                 zoom(NULL);
                 }
                 else if(ev->button == Button3 && !c->isfixed) {
- if(!isarrange(floating) && !c->isfloating)
+ if(isarrange(floating) || c->isfloating)
+ restack();
+ else
                                 togglefloating(NULL);
- else
- restack();
                         resizemouse(c);
                 }
         }
@@ -444,7 +444,7 @@ configurenotify(XEvent *e) {
 configurenotify(XEvent *e) {
         XConfigureEvent *ev = &e->xconfigure;
 
- if (ev->window == root && (ev->width != sw || ev->height != sh)) {
+ if(ev->window == root && (ev->width != sw || ev->height != sh)) {
                 sw = ev->width;
                 sh = ev->height;
                 XFreePixmap(dpy, dc.drawable);
@@ -883,7 +883,7 @@ initfont(const char *fontstr) {
                         XFreeFont(dpy, dc.font.xfont);
                 dc.font.xfont = NULL;
                 if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr))
- || !(dc.font.xfont = XLoadQueryFont(dpy, "fixed")))
+ && !(dc.font.xfont = XLoadQueryFont(dpy, "fixed")))
                         eprint("error, cannot load font: '%s'\n", fontstr);
                 dc.font.ascent = dc.font.xfont->ascent;
                 dc.font.descent = dc.font.xfont->descent;
@@ -1404,10 +1404,10 @@ setmwfact(const char *arg) {
         if(arg == NULL)
                 mwfact = MWFACT;
         else if(1 == sscanf(arg, "%lf", &delta)) {
- if(arg[0] != '+' && arg[0] != '-')
+ if(arg[0] == '+' || arg[0] == '-')
+ mwfact += delta;
+ else
                         mwfact = delta;
- else
- mwfact += delta;
                 if(mwfact < 0.1)
                         mwfact = 0.1;
                 else if(mwfact > 0.9)
@@ -1644,7 +1644,7 @@ togglemax(const char *arg) {
         }
         else {
                 resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
- if (!sel->wasfloating)
+ if(!sel->wasfloating)
                         togglefloating(NULL);
         }
         drawbar();
Received on Wed Sep 19 2007 - 17:35:14 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:58:12 UTC