diff options
| -rw-r--r-- | config.arg.h | 1 | ||||
| -rw-r--r-- | config.default.h | 1 | ||||
| -rw-r--r-- | config.mk | 4 | ||||
| -rw-r--r-- | dwm.h | 2 | ||||
| -rw-r--r-- | float.c | 41 | ||||
| -rw-r--r-- | float.h | 5 | ||||
| -rw-r--r-- | layout.c | 37 |
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 \ |
| 30 | static Layout layout[] = { \ | 29 | static 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 \ |
| 31 | static Layout layout[] = { \ | 30 | static Layout layout[] = { \ |
| 32 | /* symbol function */ \ | 31 | /* symbol function */ \ |
| @@ -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 |
| 7 | SRC = float.c tile.c | 7 | SRC = tile.c |
| 8 | 8 | ||
| 9 | # paths | 9 | # paths |
| 10 | PREFIX = /usr/local | 10 | PREFIX = /usr/local |
| @@ -120,12 +120,14 @@ unsigned int textw(const char *text); /* return the width of text in px*/ | |||
| 120 | void grabkeys(void); /* grab all keys defined in config.h */ | 120 | void grabkeys(void); /* grab all keys defined in config.h */ |
| 121 | 121 | ||
| 122 | /* layout.c */ | 122 | /* layout.c */ |
| 123 | void floating(void); /* arranges all windows floating, fallback layout */ | ||
| 123 | void focusclient(const char *arg); /* focuses next(1)/previous(-1) visible client */ | 124 | void focusclient(const char *arg); /* focuses next(1)/previous(-1) visible client */ |
| 124 | void initlayouts(void); /* initialize layout array */ | 125 | void initlayouts(void); /* initialize layout array */ |
| 125 | Client *nexttiled(Client *c); /* returns tiled successor of c */ | 126 | Client *nexttiled(Client *c); /* returns tiled successor of c */ |
| 126 | void restack(void); /* restores z layers of all clients */ | 127 | void restack(void); /* restores z layers of all clients */ |
| 127 | void setlayout(const char *arg); /* sets layout, NULL means next layout */ | 128 | void setlayout(const char *arg); /* sets layout, NULL means next layout */ |
| 128 | void togglebar(const char *arg); /* shows/hides the bar */ | 129 | void togglebar(const char *arg); /* shows/hides the bar */ |
| 130 | void togglemax(const char *arg); /* toggles maximization of floating client */ | ||
| 129 | 131 | ||
| 130 | /* main.c */ | 132 | /* main.c */ |
| 131 | void updatebarpos(void); /* updates the bar position */ | 133 | void 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 | |||
| 6 | void | ||
| 7 | floating(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 | |||
| 24 | void | ||
| 25 | togglemax(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 */ | ||
| 4 | void floating(void); /* arranges all windows floating */ | ||
| 5 | void togglemax(const char *arg); /* toggles maximization of floating client */ | ||
| @@ -14,6 +14,24 @@ LAYOUTS | |||
| 14 | /* extern */ | 14 | /* extern */ |
| 15 | 15 | ||
| 16 | void | 16 | void |
| 17 | floating(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 | |||
| 34 | void | ||
| 17 | focusclient(const char *arg) { | 35 | focusclient(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 | |||
| 137 | void | ||
| 138 | togglemax(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 | } | ||
