aboutsummaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-03-06 19:20:14 +0000
committerAnselm R Garbe <garbeam@gmail.com>2008-03-06 19:20:14 +0000
commitd7b074fcce4877ed404f6a92671689fcdee9133b (patch)
tree9fec0fcfda5c9d32eb74782bfe7ddd5362187380 /dwm.c
parentc9170189bf0d0234f8d97fd7b717f859b7242674 (diff)
downloaddwm-d7b074fcce4877ed404f6a92671689fcdee9133b.tar
dwm-d7b074fcce4877ed404f6a92671689fcdee9133b.tar.gz
dwm-d7b074fcce4877ed404f6a92671689fcdee9133b.tar.bz2
new stuff
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c49
1 files changed, 39 insertions, 10 deletions
diff --git a/dwm.c b/dwm.c
index 2985cea..f51d801 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1,6 +1,3 @@
-/**
- * - allow for vstack
- */
/* See LICENSE file for copyright and license details.
*
* dynamic window manager is designed like any other X client as well. It is
@@ -36,7 +33,6 @@
#include <sys/select.h>
#include <sys/types.h>
#include <sys/wait.h>
-#include <regex.h>
#include <X11/cursorfont.h>
#include <X11/keysym.h>
#include <X11/Xatom.h>
@@ -170,8 +166,10 @@ void spawn(const char *arg);
void tag(const char *arg);
unsigned int textnw(const char *text, unsigned int len);
unsigned int textw(const char *text);
-void tile(void);
+void tileh(void);
+void tilehstack(unsigned int n);
unsigned int tilemaster(void);
+void tilev(void);
void tilevstack(unsigned int n);
void togglefloating(const char *arg);
void toggletag(const char *arg);
@@ -1547,6 +1545,37 @@ tileresize(Client *c, int x, int y, int w, int h) {
resize(c, x, y, w, h, False);
}
+void
+tileh(void) {
+ tilehstack(tilemaster());
+}
+
+void
+tilehstack(unsigned int n) {
+ int i, x, w;
+ Client *c;
+
+ if(n == 0)
+ return;
+
+ x = TX;
+ w = (TW) / n;
+ if(w < bh)
+ w = TW;
+
+ for(i = 0, c = nexttiled(clients); c; c = nexttiled(c->next), i++)
+ if(i > 0) {
+ if(i > 1 && i == n) /* remainder */
+ tileresize(c, x, TY, ((TX) + (TW)) - x - 2 * c->border,
+ TH - 2 * c->border);
+ else
+ tileresize(c, x, TY, w - 2 * c->border,
+ TH - 2 * c->border);
+ if(w != TW)
+ x = c->x + c->w + 2 * c->border;
+ }
+}
+
unsigned int
tilemaster(void) {
unsigned int n;
@@ -1564,6 +1593,11 @@ tilemaster(void) {
}
void
+tilev(void) {
+ tilevstack(tilemaster());
+}
+
+void
tilevstack(unsigned int n) {
int i, y, h;
Client *c;
@@ -1590,11 +1624,6 @@ tilevstack(unsigned int n) {
}
void
-tile(void) {
- tilevstack(tilemaster());
-}
-
-void
togglefloating(const char *arg) {
if(!sel)
return;