From 9e78421e2ea8997a821c8633b7d762c4fc2503c0 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Sat, 4 Jun 2011 20:57:42 +0200 Subject: [PATCH] Wmfs: Optimization & cosmetic #2 --- src/frame.c | 2 +- src/layout.c | 2 +- src/wmfs.h | 6 +++--- wmfsrc | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/frame.c b/src/frame.c index 9581287..d404b85 100644 --- a/src/frame.c +++ b/src/frame.c @@ -313,7 +313,7 @@ frame_update(Client *c) if(TBARH - BORDH) barwin_draw_text(c->titlebar, (c->frame_geo.width >> 1) - (textw(c->title) >> 1), - ((font->height - font->descent) + ((TBARH - font->height) / 2)), + ((font->height - font->descent) + ((TBARH - font->height) >> 1)), c->title); return; diff --git a/src/layout.c b/src/layout.c index 350d99d..5452068 100644 --- a/src/layout.c +++ b/src/layout.c @@ -555,7 +555,7 @@ mirror(int screen, Bool horizontal) else cgeo.width = tilesize; - if((i + nmaster) % 2) + if((i + nmaster) & 1) { isp = 1; diff --git a/src/wmfs.h b/src/wmfs.h index 3fbeb4b..17e3693 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -84,12 +84,12 @@ #define MAXH DisplayHeight(dpy, DefaultScreen(dpy)) #define MAXW DisplayWidth(dpy, DefaultScreen(dpy)) #define INFOBARH ((conf.bars.height > 0) ? conf.bars.height : (font->height * 1.5)) -#define FHINFOBAR ((font->height - font->descent) + (INFOBARH - font->height) / 2) +#define FHINFOBAR ((font->height - font->descent) + (((int)INFOBARH - font->height) >> 1)) #define SHADH (1) #define BORDH conf.client.borderheight #define TBARH ((conf.titlebar.height < BORDH) ? BORDH : conf.titlebar.height) #define RESHW (6 * (BORDH)) -#define BUTTONWH (TBARH / 2) +#define BUTTONWH (TBARH >> 1) #define DEF_CONF ".config/wmfs/wmfsrc" #define DEF_STATUS ".config/wmfs/status.sh" #define PAD conf.pad @@ -109,7 +109,7 @@ #define CHECK(x) if(!(x)) return #define LEN(x) (sizeof(x) / sizeof((x)[0])) #define MAXCLIST (64) -#define RPOS(x) (x % 2 ? x - 1 : x + 1) +#define RPOS(x) (x & 1 ? x - 1 : x + 1) #define LDIR(x) (x < Top) #define FLAGAPPLY(v, b, f) ((b) ? (v |= (f)) : (v &= ~(f))) diff --git a/wmfsrc b/wmfsrc index 5e5eccf..ecf4b8a 100644 --- a/wmfsrc +++ b/wmfsrc @@ -9,7 +9,6 @@ [misc] font = "dejavu-10" raisefocus = true - raiseswitch = false focus_follow_mouse = true focus_follow_movement = false opacity = 255