aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2011-12-11 15:54:30 +0200
committerIvan Kanakarakis <ivan.kanak@gmail.com>2011-12-11 16:02:24 +0200
commitd2cce3343cdb3a08c3bca78b57826b97ca7b69ed (patch)
tree61be1a2d0447460a6c1a2f13b2f350fbd36770c7
parent2de3f0e4ebff18227ba10e9a6354bf489ab9e994 (diff)
use booleans on config - fix comments
-rw-r--r--config.h20
-rw-r--r--dminiwm.c16
2 files changed, 18 insertions, 18 deletions
diff --git a/config.h b/config.h
index 9b766d3..109de3b 100644
--- a/config.h
+++ b/config.h
@@ -24,17 +24,17 @@
#define MOD1 Mod1Mask /* ALT key */
#define MOD4 Mod4Mask /* Super/Windows key */
#define MASTER_SIZE 0.52
-#define TOP_PANEL 0 /* Place panel at the 1=bottom or 0=top */
-#define PANEL_HEIGHT 18 /* 0 for no space for a panel */
+#define TOP_PANEL True /* False mean panel is on bottom */
+#define PANEL_HEIGHT 18 /* 0 for no space for panel, thus no panel */
#define DEFAULT_MODE TILE /* TILE MONOCYCLE BSTACK GRID */
-#define ATTACH_ASIDE 0 /* 0=TRUE, 1=New window is master */
-#define FOLLOW_MOUSE 1 /* 1=Don't 0=Focus the window the mouse just entered */
-#define FOLLOW_WINDOW 1 /* 1=Don't 0=Follow the window when moved to a different desktop */
-#define CLICK_TO_FOCUS 1 /* 1=Don't 0=Focus an unfocused window when clicked */
-#define DESKTOPS 4 /* number of desktops - edit DESKTOPCHANGE keys to suit */
+#define ATTACH_ASIDE True /* False means new window is master */
+#define FOLLOW_MOUSE False /* Focus the window the mouse just entered */
+#define FOLLOW_WINDOW False /* Follow the window when moved to a different desktop */
+#define CLICK_TO_FOCUS False /* Focus an unfocused window when clicked */
#define BORDER_WIDTH 2 /* window border width */
#define FOCUS "#ff950e" /* focused window border color */
#define UNFOCUS "#444444" /* unfocused window border color */
+#define DESKTOPS 4 /* number of desktops - edit DESKTOPCHANGE keys to suit */
/** open applications to specified desktop **/
static const AppRule rules[] = { \
@@ -64,7 +64,7 @@ const char *mtogglecmd[] = { "mpc", "toggle", NULL };
/** Shortcuts **/
static key keys[] = {
-/* modifier key function argument */
+ /* modifier key function argument */
{ MOD1|ShiftMask, XK_c, killclient, {NULL}},
{ MOD1, XK_j, next_win, {NULL}},
{ MOD1, XK_k, prev_win, {NULL}},
@@ -72,8 +72,8 @@ static key keys[] = {
{ MOD1, XK_l, resize_master, {.i = +10}}, /* increase */
{ MOD1, XK_o, resize_stack, {.i = -10}}, /* shrink */
{ MOD1, XK_p, resize_stack, {.i = +10}}, /* grow */
- { MOD1|ShiftMask, XK_Left, rotate_desktop, {.i = -1}}, /* prev */
- { MOD1|ShiftMask, XK_Right, rotate_desktop, {.i = +1}}, /* next */
+ { MOD1|ShiftMask, XK_Left, rotate_desktop, {.i = -1}}, /* prev */
+ { MOD1|ShiftMask, XK_Right, rotate_desktop, {.i = +1}}, /* next */
{ MOD1, XK_Tab, last_desktop, {NULL}},
{ MOD1, XK_Return, swap_master, {NULL}},
{ MOD1|ShiftMask, XK_j, move_down, {NULL}},
diff --git a/dminiwm.c b/dminiwm.c
index 055b70a..6bdd872 100644
--- a/dminiwm.c
+++ b/dminiwm.c
@@ -165,7 +165,7 @@ void add_window(Window w) {
if(head == NULL) {
c->win = w;
head = c;
- } else if(ATTACH_ASIDE == 0) {
+ } else if(ATTACH_ASIDE) {
for(t=head; t->next; t=t->next);
c->prev = t;
c->win = w;
@@ -181,7 +181,7 @@ void add_window(Window w) {
current = c;
save_desktop(current_desktop);
- if(FOLLOW_MOUSE == 0)
+ if(FOLLOW_MOUSE)
XSelectInput(dis, c->win, EnterWindowMask);
}
@@ -313,7 +313,7 @@ void client_to_desktop(const Arg arg) {
tile();
update_current();
- if(FOLLOW_WINDOW == 0)
+ if(FOLLOW_WINDOW)
change_desktop(arg);
}
@@ -341,7 +341,7 @@ void tile(void) {
client *c;
int n = 0;
int x = 0;
- int y = (TOP_PANEL) ? 0 : PANEL_HEIGHT;
+ int y = (TOP_PANEL) ? PANEL_HEIGHT : 0;
if(head->next == NULL) {
XMoveResizeWindow(dis, head->win, 0, y, sw + 2*BORDER_WIDTH, sh + 2*BORDER_WIDTH);
@@ -461,11 +461,11 @@ void update_current(void) {
XSetWindowBorder(dis, c->win, win_focus);
XSetInputFocus(dis, c->win, RevertToParent, CurrentTime);
XRaiseWindow(dis, c->win);
- if(CLICK_TO_FOCUS == 0)
+ if(CLICK_TO_FOCUS)
XUngrabButton(dis, AnyButton, AnyModifier, c->win);
} else {
XSetWindowBorder(dis, c->win, win_unfocus);
- if(CLICK_TO_FOCUS == 0)
+ if(CLICK_TO_FOCUS)
XGrabButton(dis, AnyButton, AnyModifier, c->win, True, ButtonPressMask|ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, None);
}
}
@@ -608,7 +608,7 @@ void enternotify(XEvent *e) {
client *c;
XCrossingEvent *ev = &e->xcrossing;
- if(FOLLOW_MOUSE == 0) {
+ if(FOLLOW_MOUSE) {
if((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root)
return;
for(c=head; c; c=c->next)
@@ -624,7 +624,7 @@ void buttonpressed(XEvent *e) {
client *c;
XButtonPressedEvent *ev = &e->xbutton;
- if(CLICK_TO_FOCUS == 0 && ev->window != current->win && ev->button == Button1)
+ if(CLICK_TO_FOCUS && ev->window != current->win && ev->button == Button1)
for(c=head; c; c=c->next)
if(ev->window == c->win) {
current = c;