aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2011-11-24 03:17:15 +0200
committerIvan Kanakarakis <ivan.kanak@gmail.com>2011-11-24 03:17:15 +0200
commit5c618fc0ce01f6b82a85d3d4341cc37945ef5007 (patch)
tree39cf3b1fc02168fc2838bcc9605d99974002f083
parentce6210cb46a1f41229124afa37bc1086ff6996bd (diff)
apply resize patch
-rw-r--r--resize.diff84
-rw-r--r--src/config.h8
-rw-r--r--src/config.h.def8
-rw-r--r--src/dminiwm.c24
4 files changed, 98 insertions, 26 deletions
diff --git a/resize.diff b/resize.diff
new file mode 100644
index 0000000..e1ef985
--- /dev/null
+++ b/resize.diff
@@ -0,0 +1,84 @@
+diff --git a/src/config.h.def b/src/config.h.def
+index 19f656b..6cf99ef 100644
+--- a/src/config.h.def
++++ b/src/config.h.def
+@@ -77,14 +77,14 @@ const char* shutdowncmd[] = {"sudo","shutdown","-h","now",NULL};
+ // Shortcuts
+ static key keys[] = {
+ // MOD KEY FUNCTION ARGS
+- { MOD1, XK_h, increase, {NULL}},
+- { MOD1, XK_l, decrease, {NULL}},
++ { MOD1, XK_h, resize, {.i = -10}}, /* decrease */
++ { MOD1, XK_l, resize, {.i = +10}}, /* increase */
+ { MOD1, XK_c, kill_client, {NULL}},
+ { MOD1, XK_j, next_win, {NULL}},
+ { MOD1, XK_k, prev_win, {NULL}},
+ { MOD1, XK_v, spawn, {.com = dmenucmd}},
+- { MOD1, XK_p, grow_window, {NULL}},
+- { MOD1, XK_o, shrink_window, {NULL}},
++ { MOD1, XK_o, resize_window, {.i = -10}}, /* shrink */
++ { MOD1, XK_p, resize_window, {.i = +10}}, /* grow */
+ { MOD1, XK_Return, spawn, {.com = urxvtcmd}},
+ { MOD1, XK_Up, spawn, {.com = volupcmd}},
+ { MOD1, XK_Down, spawn, {.com = voldowncmd}},
+diff --git a/src/dminiwm.c b/src/dminiwm.c
+index 2c4915e..1d7c6fc 100644
+--- a/src/dminiwm.c
++++ b/src/dminiwm.c
+@@ -101,14 +101,13 @@ static void change_desktop(const Arg arg);
+ static void client_to_desktop(const Arg arg);
+ static void configurenotify(XEvent *e);
+ static void configurerequest(XEvent *e);
+-static void decrease();
+ static void destroynotify(XEvent *e);
+ static void enternotify(XEvent *e);
+ static void logger(const char* e);
+ static unsigned long getcolor(const char* color);
+ static void grabkeys();
+-static void grow_window();
+-static void increase();
++static void resize_window(const Arg arg);
++static void resize(const Arg arg);
+ static void keypress(XEvent *e);
+ static void kill_client();
+ static void maprequest(XEvent *e);
+@@ -124,7 +123,6 @@ static void save_desktop(int i);
+ static void select_desktop(int i);
+ static void send_kill_signal(Window w);
+ static void setup();
+-static void shrink_window();
+ static void sigchld(int unused);
+ static void spawn(const Arg arg);
+ static void start();
+@@ -350,13 +348,8 @@ void swap_master() {
+ }
+ }
+
+-void decrease() {
+- master_size -= 10;
+- tile();
+-}
+-
+-void increase() {
+- master_size += 10;
++void resize(const Arg arg) {
++ master_size += arg.i;
+ tile();
+ }
+
+@@ -625,13 +618,8 @@ void switch_grid() {
+ }
+ }
+
+-void grow_window() {
+- growth += 10;
+- tile();
+-}
+-
+-void shrink_window() {
+- growth -= 10;
++void resize_window(const Arg arg) {
++ growth += arg.i;
+ tile();
+ }
+
diff --git a/src/config.h b/src/config.h
index d275033..bce0695 100644
--- a/src/config.h
+++ b/src/config.h
@@ -76,13 +76,13 @@ const char *mtogglecmd[] = { "mpc", "toggle", NULL };
/** Shortcuts **/
static key keys[] = {
/* modifier key function argument */
- { MOD1, XK_h, decrease, {NULL} },
- { MOD1, XK_l, increase, {NULL} },
+ { MOD1, XK_h, resize, {.i = -10}}, /* decrease */
+ { MOD1, XK_l, resize, {.i = +10}}, /* increase */
{ MOD1|ShiftMask, XK_c, kill_client, {NULL} },
{ MOD1, XK_j, next_win, {NULL} },
{ MOD1, XK_k, prev_win, {NULL} },
- { MOD1, XK_p, grow_window, {NULL} },
- { MOD1, XK_o, shrink_window, {NULL} },
+ { MOD1, XK_o, resize_window, {.i = -10}}, /* shrink */
+ { MOD1, XK_p, resize_window, {.i = +10}}, /* grow */
{ MOD1, XK_Return, swap_master, {NULL} },
{ MOD1|ShiftMask, XK_j, move_down, {NULL} },
{ MOD1|ShiftMask, XK_k, move_up, {NULL} },
diff --git a/src/config.h.def b/src/config.h.def
index 4d5fa41..75c4f1f 100644
--- a/src/config.h.def
+++ b/src/config.h.def
@@ -77,14 +77,14 @@ const char* shutdowncmd[] = {"sudo","shutdown","-h","now",NULL};
// Shortcuts
static key keys[] = {
// MOD KEY FUNCTION ARGS
- { MOD1, XK_h, increase, {NULL}},
- { MOD1, XK_l, decrease, {NULL}},
+ { MOD1, XK_h, resize, {.i = -10}}, /* decrease */
+ { MOD1, XK_l, resize, {.i = +10}}, /* increase */
{ MOD1, XK_c, kill_client, {NULL}},
{ MOD1, XK_j, next_win, {NULL}},
{ MOD1, XK_k, prev_win, {NULL}},
{ MOD1, XK_v, spawn, {.com = dmenucmd}},
- { MOD1, XK_p, grow_window, {NULL}},
- { MOD1, XK_o, shrink_window, {NULL}},
+ { MOD1, XK_o, resize_window, {.i = -10}}, /* shrink */
+ { MOD1, XK_p, resize_window, {.i = +10}}, /* grow */
{ MOD1, XK_Return, spawn, {.com = urxvtcmd}},
{ MOD1, XK_Up, spawn, {.com = volupcmd}},
{ MOD1, XK_Down, spawn, {.com = voldowncmd}},
diff --git a/src/dminiwm.c b/src/dminiwm.c
index 05df5c2..d26dfff 100644
--- a/src/dminiwm.c
+++ b/src/dminiwm.c
@@ -101,14 +101,13 @@ static void change_desktop(const Arg arg);
static void client_to_desktop(const Arg arg);
static void configurenotify(XEvent *e);
static void configurerequest(XEvent *e);
-static void decrease();
static void destroynotify(XEvent *e);
static void enternotify(XEvent *e);
static void logger(const char* e);
static unsigned long getcolor(const char* color);
static void grabkeys();
-static void grow_window();
-static void increase();
+static void resize_window(const Arg arg);
+static void resize(const Arg arg);
static void keypress(XEvent *e);
static void kill_client();
static void maprequest(XEvent *e);
@@ -124,7 +123,6 @@ static void save_desktop(int i);
static void select_desktop(int i);
static void send_kill_signal(Window w);
static void setup();
-static void shrink_window();
static void sigchld(int unused);
static void spawn(const Arg arg);
static void start();
@@ -350,13 +348,8 @@ void swap_master() {
}
}
-void decrease() {
- master_size -= 10;
- tile();
-}
-
-void increase() {
- master_size += 10;
+void resize(const Arg arg) {
+ master_size += arg.i;
tile();
}
@@ -625,13 +618,8 @@ void switch_grid() {
}
}
-void grow_window() {
- growth += 10;
- tile();
-}
-
-void shrink_window() {
- growth -= 10;
+void resize_window(const Arg arg) {
+ growth += arg.i;
tile();
}