summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorarg@suckless.org <unknown>2007-09-19 17:32:28 +0200
committerarg@suckless.org <unknown>2007-09-19 17:32:28 +0200
commit1fafcb1820d37dbf58a864f2c10e1e24ae1a21d1 (patch)
tree74ecec80605b5b877a30f7f0075fd012ae7f6dce /dwm.c
parentapplied Peter Hartlich's togglemax patch to allow toggling tiled clients to m... (diff)
downloaddwm-1fafcb1820d37dbf58a864f2c10e1e24ae1a21d1.tar.gz
dwm-1fafcb1820d37dbf58a864f2c10e1e24ae1a21d1.zip
applied Peters patch, applied yiyus hint to initfont
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/dwm.c b/dwm.c
index 36ca4eb..8762269 100644
--- a/dwm.c
+++ b/dwm.c
@@ -334,10 +334,10 @@ buttonpress(XEvent *e) {
334 if(CLEANMASK(ev->state) != MODKEY) 334 if(CLEANMASK(ev->state) != MODKEY)
335 return; 335 return;
336 if(ev->button == Button1) { 336 if(ev->button == Button1) {
337 if(!isarrange(floating) && !c->isfloating) 337 if(isarrange(floating) || c->isfloating)
338 togglefloating(NULL);
339 else
340 restack(); 338 restack();
339 else
340 togglefloating(NULL);
341 movemouse(c); 341 movemouse(c);
342 } 342 }
343 else if(ev->button == Button2) { 343 else if(ev->button == Button2) {
@@ -347,10 +347,10 @@ buttonpress(XEvent *e) {
347 zoom(NULL); 347 zoom(NULL);
348 } 348 }
349 else if(ev->button == Button3 && !c->isfixed) { 349 else if(ev->button == Button3 && !c->isfixed) {
350 if(!isarrange(floating) && !c->isfloating) 350 if(isarrange(floating) || c->isfloating)
351 togglefloating(NULL);
352 else
353 restack(); 351 restack();
352 else
353 togglefloating(NULL);
354 resizemouse(c); 354 resizemouse(c);
355 } 355 }
356 } 356 }
@@ -444,7 +444,7 @@ void
444configurenotify(XEvent *e) { 444configurenotify(XEvent *e) {
445 XConfigureEvent *ev = &e->xconfigure; 445 XConfigureEvent *ev = &e->xconfigure;
446 446
447 if (ev->window == root && (ev->width != sw || ev->height != sh)) { 447 if(ev->window == root && (ev->width != sw || ev->height != sh)) {
448 sw = ev->width; 448 sw = ev->width;
449 sh = ev->height; 449 sh = ev->height;
450 XFreePixmap(dpy, dc.drawable); 450 XFreePixmap(dpy, dc.drawable);
@@ -883,7 +883,7 @@ initfont(const char *fontstr) {
883 XFreeFont(dpy, dc.font.xfont); 883 XFreeFont(dpy, dc.font.xfont);
884 dc.font.xfont = NULL; 884 dc.font.xfont = NULL;
885 if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr)) 885 if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr))
886 || !(dc.font.xfont = XLoadQueryFont(dpy, "fixed"))) 886 && !(dc.font.xfont = XLoadQueryFont(dpy, "fixed")))
887 eprint("error, cannot load font: '%s'\n", fontstr); 887 eprint("error, cannot load font: '%s'\n", fontstr);
888 dc.font.ascent = dc.font.xfont->ascent; 888 dc.font.ascent = dc.font.xfont->ascent;
889 dc.font.descent = dc.font.xfont->descent; 889 dc.font.descent = dc.font.xfont->descent;
@@ -1404,10 +1404,10 @@ setmwfact(const char *arg) {
1404 if(arg == NULL) 1404 if(arg == NULL)
1405 mwfact = MWFACT; 1405 mwfact = MWFACT;
1406 else if(1 == sscanf(arg, "%lf", &delta)) { 1406 else if(1 == sscanf(arg, "%lf", &delta)) {
1407 if(arg[0] != '+' && arg[0] != '-') 1407 if(arg[0] == '+' || arg[0] == '-')
1408 mwfact = delta;
1409 else
1410 mwfact += delta; 1408 mwfact += delta;
1409 else
1410 mwfact = delta;
1411 if(mwfact < 0.1) 1411 if(mwfact < 0.1)
1412 mwfact = 0.1; 1412 mwfact = 0.1;
1413 else if(mwfact > 0.9) 1413 else if(mwfact > 0.9)
@@ -1644,7 +1644,7 @@ togglemax(const char *arg) {
1644 } 1644 }
1645 else { 1645 else {
1646 resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True); 1646 resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
1647 if (!sel->wasfloating) 1647 if(!sel->wasfloating)
1648 togglefloating(NULL); 1648 togglefloating(NULL);
1649 } 1649 }
1650 drawbar(); 1650 drawbar();