summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--config.arg.h1
-rw-r--r--config.default.h1
-rw-r--r--config.mk4
-rw-r--r--dwm.h2
-rw-r--r--float.c41
-rw-r--r--float.h5
-rw-r--r--layout.c37
7 files changed, 41 insertions, 50 deletions
diff --git a/config.arg.h b/config.arg.h
index 9a5bdc6..18be75b 100644
--- a/config.arg.h
+++ b/config.arg.h
@@ -25,7 +25,6 @@ static Rule rule[] = { \
25 25
26/* layout(s) */ 26/* layout(s) */
27#include "tile.h" 27#include "tile.h"
28#include "float.h"
29#define LAYOUTS \ 28#define LAYOUTS \
30static Layout layout[] = { \ 29static Layout layout[] = { \
31 /* symbol function */ \ 30 /* symbol function */ \
diff --git a/config.default.h b/config.default.h
index 83d244d..dcf13e3 100644
--- a/config.default.h
+++ b/config.default.h
@@ -26,7 +26,6 @@ static Rule rule[] = { \
26 26
27/* layout(s) */ 27/* layout(s) */
28#include "tile.h" 28#include "tile.h"
29#include "float.h"
30#define LAYOUTS \ 29#define LAYOUTS \
31static Layout layout[] = { \ 30static Layout layout[] = { \
32 /* symbol function */ \ 31 /* symbol function */ \
diff --git a/config.mk b/config.mk
index 6d8f1e8..682bb41 100644
--- a/config.mk
+++ b/config.mk
@@ -3,8 +3,8 @@ VERSION = 4.4
3 3
4# Customize below to fit your system 4# Customize below to fit your system
5 5
6# layouts 6# additional layouts beside floating
7SRC = float.c tile.c 7SRC = tile.c
8 8
9# paths 9# paths
10PREFIX = /usr/local 10PREFIX = /usr/local
diff --git a/dwm.h b/dwm.h
index c2f1e7e..760d67d 100644
--- a/dwm.h
+++ b/dwm.h
@@ -120,12 +120,14 @@ unsigned int textw(const char *text); /* return the width of text in px*/
120void grabkeys(void); /* grab all keys defined in config.h */ 120void grabkeys(void); /* grab all keys defined in config.h */
121 121
122/* layout.c */ 122/* layout.c */
123void floating(void); /* arranges all windows floating, fallback layout */
123void focusclient(const char *arg); /* focuses next(1)/previous(-1) visible client */ 124void focusclient(const char *arg); /* focuses next(1)/previous(-1) visible client */
124void initlayouts(void); /* initialize layout array */ 125void initlayouts(void); /* initialize layout array */
125Client *nexttiled(Client *c); /* returns tiled successor of c */ 126Client *nexttiled(Client *c); /* returns tiled successor of c */
126void restack(void); /* restores z layers of all clients */ 127void restack(void); /* restores z layers of all clients */
127void setlayout(const char *arg); /* sets layout, NULL means next layout */ 128void setlayout(const char *arg); /* sets layout, NULL means next layout */
128void togglebar(const char *arg); /* shows/hides the bar */ 129void togglebar(const char *arg); /* shows/hides the bar */
130void togglemax(const char *arg); /* toggles maximization of floating client */
129 131
130/* main.c */ 132/* main.c */
131void updatebarpos(void); /* updates the bar position */ 133void updatebarpos(void); /* updates the bar position */
diff --git a/float.c b/float.c
deleted file mode 100644
index 25bec69..0000000
--- a/float.c
+++ /dev/null
@@ -1,41 +0,0 @@
1/* See LICENSE file for copyright and license details. */
2#include "dwm.h"
3
4/* extern */
5
6void
7floating(void) {
8 Client *c;
9
10 if(lt->arrange != floating)
11 return;
12
13 for(c = clients; c; c = c->next)
14 if(isvisible(c)) {
15 unban(c);
16 resize(c, c->x, c->y, c->w, c->h, True);
17 }
18 else
19 ban(c);
20 focus(NULL);
21 restack();
22}
23
24void
25togglemax(const char *arg) {
26 XEvent ev;
27
28 if(!sel || (lt->arrange != floating && !sel->isfloating) || sel->isfixed)
29 return;
30 if((sel->ismax = !sel->ismax)) {
31 sel->rx = sel->x;
32 sel->ry = sel->y;
33 sel->rw = sel->w;
34 sel->rh = sel->h;
35 resize(sel, wax, way, waw - 2 * sel->border, wah - 2 * sel->border, True);
36 }
37 else
38 resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
39 drawstatus();
40 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
41}
diff --git a/float.h b/float.h
deleted file mode 100644
index 6acbe64..0000000
--- a/float.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/* See LICENSE file for copyright and license details. */
2
3/* float.c */
4void floating(void); /* arranges all windows floating */
5void togglemax(const char *arg); /* toggles maximization of floating client */
diff --git a/layout.c b/layout.c
index 408a2a3..fe12e1e 100644
--- a/layout.c
+++ b/layout.c
@@ -14,6 +14,24 @@ LAYOUTS
14/* extern */ 14/* extern */
15 15
16void 16void
17floating(void) {
18 Client *c;
19
20 if(lt->arrange != floating)
21 return;
22
23 for(c = clients; c; c = c->next)
24 if(isvisible(c)) {
25 unban(c);
26 resize(c, c->x, c->y, c->w, c->h, True);
27 }
28 else
29 ban(c);
30 focus(NULL);
31 restack();
32}
33
34void
17focusclient(const char *arg) { 35focusclient(const char *arg) {
18 Client *c; 36 Client *c;
19 37
@@ -115,3 +133,22 @@ togglebar(const char *arg) {
115 updatebarpos(); 133 updatebarpos();
116 lt->arrange(); 134 lt->arrange();
117} 135}
136
137void
138togglemax(const char *arg) {
139 XEvent ev;
140
141 if(!sel || (lt->arrange != floating && !sel->isfloating) || sel->isfixed)
142 return;
143 if((sel->ismax = !sel->ismax)) {
144 sel->rx = sel->x;
145 sel->ry = sel->y;
146 sel->rw = sel->w;
147 sel->rh = sel->h;
148 resize(sel, wax, way, waw - 2 * sel->border, wah - 2 * sel->border, True);
149 }
150 else
151 resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
152 drawstatus();
153 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
154}