aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.h28
-rw-r--r--dminiwm.c53
2 files changed, 39 insertions, 42 deletions
diff --git a/config.h b/config.h
index 728ce04..59ada5c 100644
--- a/config.h
+++ b/config.h
@@ -21,22 +21,20 @@
#define CLEANMASK(mask) (mask & ~(numlockmask | LockMask))
/** generic settings **/
-#define MOD1 Mod1Mask /* ALT key */
-#define MOD4 Mod4Mask /* Super/Windows key */
+#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 BORDER_WIDTH 2
-#define ATTACH_ASIDE 0 /* 0=TRUE, 1=New window is master */
-#define DEFAULT_MODE 0 /* 0=Vertical, 1=Fullscreen 2=Horizontal 3=grid */
-#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 /* Must edit DESKTOPCHANGE keys to suit */
-
-/** Colors **/
-#define FOCUS "#ff950e"
-#define UNFOCUS "#444444"
+#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 ATTACH_ASIDE 0 /* 0=TRUE, 1=New window is master */
+#define DEFAULT_MODE 0 /* 0=Vertical 1=Fullscreen 2=Horizontal 3=grid */
+#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 BORDER_WIDTH 2 /* window border width */
+#define FOCUS "#ff950e" /* focused window border color */
+#define UNFOCUS "#444444" /* unfocused window border color */
/** Applications to a specific desktop **/
static const Convenience convenience[] = { \
diff --git a/dminiwm.c b/dminiwm.c
index 51091be..b634f19 100644
--- a/dminiwm.c
+++ b/dminiwm.c
@@ -104,14 +104,14 @@ static void checkotherwm(void);
static unsigned long getcolor(const char* color);
static void grabkeys(void);
static void keypress(XEvent *e);
-static void kill_client();
+static void kill_client(const Arg arg);
static void maprequest(XEvent *e);
-static void move_down();
-static void move_up();
+static void move_down(const Arg arg);
+static void move_up(const Arg arg);
static void rotate_desktop(const Arg arg);
-static void next_win();
-static void prev_win();
-static void quit();
+static void next_win(const Arg arg);
+static void prev_win(const Arg arg);
+static void quit(const Arg arg);
static void remove_window(Window w);
static void resize_master(const Arg arg);
static void resize_stack(const Arg arg);
@@ -122,13 +122,13 @@ static void setup(void);
static void sigchld(int unused);
static void spawn(const Arg arg);
static void run(void);
-static void swap_master();
+static void swap_master(const Arg arg);
static void tile(void);
-static void last_desktop();
-static void switch_fullscreen();
-static void switch_grid();
-static void switch_horizontal();
-static void switch_vertical();
+static void last_desktop(const Arg arg);
+static void switch_fullscreen(const Arg arg);
+static void switch_grid(const Arg arg);
+static void switch_horizontal(const Arg arg);
+static void switch_vertical(const Arg arg);
static void update_current(void);
#include "config.h"
@@ -249,7 +249,7 @@ void remove_window(Window w) {
}
}
-void kill_client(void) {
+void kill_client(const Arg arg) {
if(current == NULL) return;
//send delete signal to window
XEvent ke;
@@ -264,7 +264,7 @@ void kill_client(void) {
remove_window(current->win);
}
-void next_win(void) {
+void next_win(const Arg arg) {
client *c;
if(current != NULL && head != NULL) {
@@ -280,7 +280,7 @@ void next_win(void) {
}
}
-void prev_win(void) {
+void prev_win(const Arg arg) {
client *c;
if(current != NULL && head != NULL) {
@@ -296,7 +296,7 @@ void prev_win(void) {
}
}
-void move_down(void) {
+void move_down(const Arg arg) {
Window tmp;
if(current == NULL || current->next == NULL || current->win == head->win || current->prev == NULL)
return;
@@ -304,13 +304,12 @@ void move_down(void) {
tmp = current->win;
current->win = current->next->win;
current->next->win = tmp;
- //keep the moved window activated
- next_win();
+ next_win((Arg){NULL});
save_desktop(current_desktop);
tile();
}
-void move_up(void) {
+void move_up(const Arg arg) {
Window tmp;
if(current == NULL || current->prev == head || current->win == head->win) {
return;
@@ -318,12 +317,12 @@ void move_up(void) {
tmp = current->win;
current->win = current->prev->win;
current->prev->win = tmp;
- prev_win();
+ prev_win((Arg){NULL});
save_desktop(current_desktop);
tile();
}
-void swap_master(void) {
+void swap_master(const Arg arg) {
Window tmp;
if(head->next != NULL && current != NULL && mode != 1) {
@@ -371,7 +370,7 @@ void change_desktop(const Arg arg) {
update_current();
}
-void last_desktop(void) {
+void last_desktop(const Arg arg) {
Arg a = {.i = previous_desktop};
change_desktop(a);
}
@@ -567,7 +566,7 @@ void update_current(void) {
XSync(dis, False);
}
-void switch_vertical(void) {
+void switch_vertical(const Arg arg) {
if(mode == 0) return;
mode = 0;
master_size = sw * MASTER_SIZE;
@@ -575,21 +574,21 @@ void switch_vertical(void) {
update_current();
}
-void switch_fullscreen(void) {
+void switch_fullscreen(const Arg arg) {
if(mode == 1) return;
mode = 1;
tile();
update_current();
}
-void switch_horizontal(void) {
+void switch_horizontal(const Arg arg) {
if(mode == 2) return;
mode = 2;
master_size = sh * MASTER_SIZE;
tile();
}
-void switch_grid(void) {
+void switch_grid(const Arg arg) {
if(mode == 3) return;
mode = 3;
master_size = sw * MASTER_SIZE;
@@ -824,7 +823,7 @@ unsigned long getcolor(const char* color) {
}
/* FIXME: fix segfaults */
-void quit(void) {
+void quit(const Arg arg) {
Window root_return, parent;
Window *children;
int i;