diff options
| author | Anselm R. Garbe <arg@suckless.org> | 2007-02-22 22:10:16 +0100 |
|---|---|---|
| committer | Anselm R. Garbe <arg@suckless.org> | 2007-02-22 22:10:16 +0100 |
| commit | 338c0838580b32f1258a800392d93cf973baf1e6 (patch) | |
| tree | 30387958f30336d7617f63a085128cbe40651d2f | |
| parent | hahaha, untiled and non-untiled sounded really cumbersome (diff) | |
| download | dwm-338c0838580b32f1258a800392d93cf973baf1e6.tar.gz dwm-338c0838580b32f1258a800392d93cf973baf1e6.zip | |
renamed untiled into floating, keeping tiled instead of tiling (afaik tiled sounds more correct) - English speakers convinced me
Diffstat (limited to '')
| -rw-r--r-- | client.c | 10 | ||||
| -rw-r--r-- | config.arg.h | 6 | ||||
| -rw-r--r-- | config.default.h | 6 | ||||
| -rw-r--r-- | draw.c | 2 | ||||
| -rw-r--r-- | dwm.1 | 22 | ||||
| -rw-r--r-- | dwm.h | 8 | ||||
| -rw-r--r-- | event.c | 8 | ||||
| -rw-r--r-- | layout.c | 60 | ||||
| -rw-r--r-- | tag.c | 4 |
9 files changed, 63 insertions, 63 deletions
| @@ -203,8 +203,8 @@ manage(Window w, XWindowAttributes *wa) { | |||
| 203 | updatetitle(c); | 203 | updatetitle(c); |
| 204 | for(t = clients; t && t->win != trans; t = t->next); | 204 | for(t = clients; t && t->win != trans; t = t->next); |
| 205 | settags(c, t); | 205 | settags(c, t); |
| 206 | if(!c->isuntiled) | 206 | if(!c->isfloating) |
| 207 | c->isuntiled = (t != NULL) || c->isfixed; | 207 | c->isfloating = (t != NULL) || c->isfixed; |
| 208 | attach(c); | 208 | attach(c); |
| 209 | attachstack(c); | 209 | attachstack(c); |
| 210 | c->isbanned = True; | 210 | c->isbanned = True; |
| @@ -285,10 +285,10 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) { | |||
| 285 | } | 285 | } |
| 286 | 286 | ||
| 287 | void | 287 | void |
| 288 | toggletiled(const char *arg) { | 288 | togglefloating(const char *arg) { |
| 289 | if(!sel || lt->arrange == untile) | 289 | if(!sel || lt->arrange == floating) |
| 290 | return; | 290 | return; |
| 291 | sel->isuntiled = !sel->isuntiled; | 291 | sel->isfloating = !sel->isfloating; |
| 292 | lt->arrange(); | 292 | lt->arrange(); |
| 293 | } | 293 | } |
| 294 | 294 | ||
diff --git a/config.arg.h b/config.arg.h index f286769..7452a2f 100644 --- a/config.arg.h +++ b/config.arg.h | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL }; | 18 | const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL }; |
| 19 | #define RULES \ | 19 | #define RULES \ |
| 20 | static Rule rule[] = { \ | 20 | static Rule rule[] = { \ |
| 21 | /* class:instance:title regex tags regex isuntiled */ \ | 21 | /* class:instance:title regex tags regex isfloating */ \ |
| 22 | { "Firefox", "3", False }, \ | 22 | { "Firefox", "3", False }, \ |
| 23 | { "Gimp", NULL, True }, \ | 23 | { "Gimp", NULL, True }, \ |
| 24 | { "MPlayer", NULL, True }, \ | 24 | { "MPlayer", NULL, True }, \ |
| @@ -30,7 +30,7 @@ static Rule rule[] = { \ | |||
| 30 | static Layout layout[] = { \ | 30 | static Layout layout[] = { \ |
| 31 | /* symbol function */ \ | 31 | /* symbol function */ \ |
| 32 | { "[]=", tile }, /* first entry is default */ \ | 32 | { "[]=", tile }, /* first entry is default */ \ |
| 33 | { "><>", untile }, \ | 33 | { "><>", floating }, \ |
| 34 | }; | 34 | }; |
| 35 | #define MASTERWIDTH 600 /* master width per thousand */ | 35 | #define MASTERWIDTH 600 /* master width per thousand */ |
| 36 | #define NMASTER 1 /* clients in master area */ | 36 | #define NMASTER 1 /* clients in master area */ |
| @@ -56,7 +56,7 @@ static Key key[] = { \ | |||
| 56 | { MODKEY, XK_k, focusclient, "-1" }, \ | 56 | { MODKEY, XK_k, focusclient, "-1" }, \ |
| 57 | { MODKEY, XK_m, togglemax, NULL }, \ | 57 | { MODKEY, XK_m, togglemax, NULL }, \ |
| 58 | { MODKEY, XK_Return, zoom, NULL }, \ | 58 | { MODKEY, XK_Return, zoom, NULL }, \ |
| 59 | { MODKEY|ShiftMask, XK_space, toggletiled, NULL }, \ | 59 | { MODKEY|ShiftMask, XK_space, togglefloating, NULL }, \ |
| 60 | { MODKEY|ShiftMask, XK_c, killclient, NULL }, \ | 60 | { MODKEY|ShiftMask, XK_c, killclient, NULL }, \ |
| 61 | { MODKEY, XK_0, view, NULL }, \ | 61 | { MODKEY, XK_0, view, NULL }, \ |
| 62 | { MODKEY, XK_1, view, "0" }, \ | 62 | { MODKEY, XK_1, view, "0" }, \ |
diff --git a/config.default.h b/config.default.h index 1632f50..9813ef7 100644 --- a/config.default.h +++ b/config.default.h | |||
| @@ -20,7 +20,7 @@ const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL }; | |||
| 20 | * xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */ | 20 | * xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */ |
| 21 | #define RULES \ | 21 | #define RULES \ |
| 22 | static Rule rule[] = { \ | 22 | static Rule rule[] = { \ |
| 23 | /* class:instance:title regex tags regex isuntiled */ \ | 23 | /* class:instance:title regex tags regex isfloating */ \ |
| 24 | { "Gimp", NULL, True }, \ | 24 | { "Gimp", NULL, True }, \ |
| 25 | { "MPlayer", NULL, True }, \ | 25 | { "MPlayer", NULL, True }, \ |
| 26 | { "Acroread", NULL, True }, \ | 26 | { "Acroread", NULL, True }, \ |
| @@ -31,7 +31,7 @@ static Rule rule[] = { \ | |||
| 31 | static Layout layout[] = { \ | 31 | static Layout layout[] = { \ |
| 32 | /* symbol function */ \ | 32 | /* symbol function */ \ |
| 33 | { "[]=", tile }, /* first entry is default */ \ | 33 | { "[]=", tile }, /* first entry is default */ \ |
| 34 | { "><>", untile }, \ | 34 | { "><>", floating }, \ |
| 35 | }; | 35 | }; |
| 36 | #define MASTERWIDTH 640 /* master width per thousand */ | 36 | #define MASTERWIDTH 640 /* master width per thousand */ |
| 37 | #define NMASTER 1 /* clients in master area */ | 37 | #define NMASTER 1 /* clients in master area */ |
| @@ -52,7 +52,7 @@ static Key key[] = { \ | |||
| 52 | { MODKEY|ShiftMask, XK_Tab, focusclient, "-1" }, \ | 52 | { MODKEY|ShiftMask, XK_Tab, focusclient, "-1" }, \ |
| 53 | { MODKEY, XK_m, togglemax, NULL }, \ | 53 | { MODKEY, XK_m, togglemax, NULL }, \ |
| 54 | { MODKEY, XK_Return, zoom, NULL }, \ | 54 | { MODKEY, XK_Return, zoom, NULL }, \ |
| 55 | { MODKEY|ShiftMask, XK_space, toggletiled, NULL }, \ | 55 | { MODKEY|ShiftMask, XK_space, togglefloating, NULL }, \ |
| 56 | { MODKEY|ShiftMask, XK_c, killclient, NULL }, \ | 56 | { MODKEY|ShiftMask, XK_c, killclient, NULL }, \ |
| 57 | { MODKEY, XK_0, view, NULL }, \ | 57 | { MODKEY, XK_0, view, NULL }, \ |
| 58 | { MODKEY, XK_1, view, "0" }, \ | 58 | { MODKEY, XK_1, view, "0" }, \ |
| @@ -81,7 +81,7 @@ drawstatus(void) { | |||
| 81 | dc.x = x; | 81 | dc.x = x; |
| 82 | if(sel) { | 82 | if(sel) { |
| 83 | drawtext(sel->name, dc.sel); | 83 | drawtext(sel->name, dc.sel); |
| 84 | drawsquare(sel->ismax, sel->isuntiled, dc.sel); | 84 | drawsquare(sel->ismax, sel->isfloating, dc.sel); |
| 85 | } | 85 | } |
| 86 | else | 86 | else |
| 87 | drawtext(NULL, dc.norm); | 87 | drawtext(NULL, dc.norm); |
| @@ -6,13 +6,13 @@ dwm \- dynamic window manager | |||
| 6 | .RB [ \-v ] | 6 | .RB [ \-v ] |
| 7 | .SH DESCRIPTION | 7 | .SH DESCRIPTION |
| 8 | dwm is a dynamic window manager for X. It manages windows in tiled and | 8 | dwm is a dynamic window manager for X. It manages windows in tiled and |
| 9 | untiled layouts. Either layout can be applied dynamically, optimizing the | 9 | floating layouts. Either layout can be applied dynamically, optimizing the |
| 10 | environment for the application in use and the task performed. | 10 | environment for the application in use and the task performed. |
| 11 | .P | 11 | .P |
| 12 | In tiled layout windows are managed in a master and stacking area. The master | 12 | In tiled layout windows are managed in a master and stacking area. The master |
| 13 | area contains the windows which currently need most attention, whereas the | 13 | area contains the windows which currently need most attention, whereas the |
| 14 | stacking area contains all other windows. In untiled layout windows can be | 14 | stacking area contains all other windows. In floating layout windows can be |
| 15 | resized and moved freely. Dialog windows are always managed untiled, | 15 | resized and moved freely. Dialog windows are always managed floating, |
| 16 | regardless of the layout applied. | 16 | regardless of the layout applied. |
| 17 | .P | 17 | .P |
| 18 | Windows are grouped by tags. Each window can be tagged with one or multiple | 18 | Windows are grouped by tags. Each window can be tagged with one or multiple |
| @@ -20,8 +20,8 @@ tags. Selecting certain tags displays all windows with these tags. | |||
| 20 | .P | 20 | .P |
| 21 | dwm contains a small status bar which displays all available tags, the layout, | 21 | dwm contains a small status bar which displays all available tags, the layout, |
| 22 | the title of the focused window, and the text read from standard input. A | 22 | the title of the focused window, and the text read from standard input. A |
| 23 | untiled window is indicated with an empty square and a maximized | 23 | floating window is indicated with an empty square and a maximized |
| 24 | untiled window is indicated with a filled square before the windows | 24 | floating window is indicated with a filled square before the windows |
| 25 | title. The selected tags are indicated with a different color. The tags of | 25 | title. The selected tags are indicated with a different color. The tags of |
| 26 | the focused window are indicated with a filled square in the top left | 26 | the focused window are indicated with a filled square in the top left |
| 27 | corner. The tags which are applied to one or more windows are indicated | 27 | corner. The tags which are applied to one or more windows are indicated |
| @@ -40,7 +40,7 @@ is read and displayed in the status text area. | |||
| 40 | .TP | 40 | .TP |
| 41 | .B Button1 | 41 | .B Button1 |
| 42 | click on a tag label to display all windows with that tag, click on the layout | 42 | click on a tag label to display all windows with that tag, click on the layout |
| 43 | label toggles between tiled and untiled layout. | 43 | label toggles between tiled and floating layout. |
| 44 | .TP | 44 | .TP |
| 45 | .B Button3 | 45 | .B Button3 |
| 46 | click on a tag label adds/removes all windows with that tag to/from the view. | 46 | click on a tag label adds/removes all windows with that tag to/from the view. |
| @@ -78,7 +78,7 @@ Increase the number of windows in the master area (tiled layout only). | |||
| 78 | Decrease the number of windows in the master area (tiled layout only). | 78 | Decrease the number of windows in the master area (tiled layout only). |
| 79 | .TP | 79 | .TP |
| 80 | .B Mod1-m | 80 | .B Mod1-m |
| 81 | Toggles maximization of current window (untiled layout only). | 81 | Toggles maximization of current window (floating layout only). |
| 82 | .TP | 82 | .TP |
| 83 | .B Mod1-Shift-[1..n] | 83 | .B Mod1-Shift-[1..n] |
| 84 | Apply | 84 | Apply |
| @@ -97,10 +97,10 @@ tag to/from current window. | |||
| 97 | Close focused window. | 97 | Close focused window. |
| 98 | .TP | 98 | .TP |
| 99 | .B Mod1-space | 99 | .B Mod1-space |
| 100 | Toggle between tiled and untiled layout (affects all windows). | 100 | Toggle between tiled and floating layout (affects all windows). |
| 101 | .TP | 101 | .TP |
| 102 | .B Mod1-Shift-space | 102 | .B Mod1-Shift-space |
| 103 | Toggle focused window between tiled and untiled state (tiled layout only). | 103 | Toggle focused window between tiled and floating state (tiled layout only). |
| 104 | .TP | 104 | .TP |
| 105 | .B Mod1-[1..n] | 105 | .B Mod1-[1..n] |
| 106 | View all windows with | 106 | View all windows with |
| @@ -120,13 +120,13 @@ Quit dwm. | |||
| 120 | .SS Mouse commands | 120 | .SS Mouse commands |
| 121 | .TP | 121 | .TP |
| 122 | .B Mod1-Button1 | 122 | .B Mod1-Button1 |
| 123 | Move current window while dragging (untiled layout only). | 123 | Move current window while dragging (floating layout only). |
| 124 | .TP | 124 | .TP |
| 125 | .B Mod1-Button2 | 125 | .B Mod1-Button2 |
| 126 | Zooms/cycles current window to/from master area (tiled layout only). | 126 | Zooms/cycles current window to/from master area (tiled layout only). |
| 127 | .TP | 127 | .TP |
| 128 | .B Mod1-Button3 | 128 | .B Mod1-Button3 |
| 129 | Resize current window while dragging (untiled layout only). | 129 | Resize current window while dragging (floating layout only). |
| 130 | .SH CUSTOMIZATION | 130 | .SH CUSTOMIZATION |
| 131 | dwm is customized by creating a custom config.h and (re)compiling the source | 131 | dwm is customized by creating a custom config.h and (re)compiling the source |
| 132 | code. This keeps it fast, secure and simple. | 132 | code. This keeps it fast, secure and simple. |
| @@ -50,7 +50,7 @@ struct Client { | |||
| 50 | int minax, minay, maxax, maxay; | 50 | int minax, minay, maxax, maxay; |
| 51 | long flags; | 51 | long flags; |
| 52 | unsigned int border; | 52 | unsigned int border; |
| 53 | Bool isbanned, isfixed, ismax, isuntiled; | 53 | Bool isbanned, isfixed, ismax, isfloating; |
| 54 | Bool *tags; | 54 | Bool *tags; |
| 55 | Client *next; | 55 | Client *next; |
| 56 | Client *prev; | 56 | Client *prev; |
| @@ -103,7 +103,7 @@ extern void killclient(const char *arg); /* kill c nicely */ | |||
| 103 | extern void manage(Window w, XWindowAttributes *wa); /* manage new client */ | 103 | extern void manage(Window w, XWindowAttributes *wa); /* manage new client */ |
| 104 | extern void resize(Client *c, int x, int y, | 104 | extern void resize(Client *c, int x, int y, |
| 105 | int w, int h, Bool sizehints); /* resize with given coordinates c*/ | 105 | int w, int h, Bool sizehints); /* resize with given coordinates c*/ |
| 106 | extern void toggletiled(const char *arg); /* toggles focused client between tiled/untiled state */ | 106 | extern void togglefloating(const char *arg); /* toggles focused client between floating/tiled state */ |
| 107 | extern void updatesizehints(Client *c); /* update the size hint variables of c */ | 107 | extern void updatesizehints(Client *c); /* update the size hint variables of c */ |
| 108 | extern void updatetitle(Client *c); /* update the name of c */ | 108 | extern void updatetitle(Client *c); /* update the name of c */ |
| 109 | extern void unmanage(Client *c); /* destroy c */ | 109 | extern void unmanage(Client *c); /* destroy c */ |
| @@ -117,6 +117,7 @@ extern unsigned int textw(const char *text); /* return the width of text in px*/ | |||
| 117 | extern void grabkeys(void); /* grab all keys defined in config.h */ | 117 | extern void grabkeys(void); /* grab all keys defined in config.h */ |
| 118 | 118 | ||
| 119 | /* layout.c */ | 119 | /* layout.c */ |
| 120 | extern void floating(void); /* arranges all windows floating */ | ||
| 120 | extern void focusclient(const char *arg); /* focuses next(1)/previous(-1) visible client */ | 121 | extern void focusclient(const char *arg); /* focuses next(1)/previous(-1) visible client */ |
| 121 | extern void incmasterw(const char *arg); /* increments the master width with arg's index value */ | 122 | extern void incmasterw(const char *arg); /* increments the master width with arg's index value */ |
| 122 | extern void incnmaster(const char *arg); /* increments nmaster with arg's index value */ | 123 | extern void incnmaster(const char *arg); /* increments nmaster with arg's index value */ |
| @@ -124,8 +125,7 @@ extern void initlayouts(void); /* initialize layout array */ | |||
| 124 | extern Client *nexttiled(Client *c); /* returns tiled successor of c */ | 125 | extern Client *nexttiled(Client *c); /* returns tiled successor of c */ |
| 125 | extern void restack(void); /* restores z layers of all clients */ | 126 | extern void restack(void); /* restores z layers of all clients */ |
| 126 | extern void setlayout(const char *arg); /* sets layout, -1 toggles */ | 127 | extern void setlayout(const char *arg); /* sets layout, -1 toggles */ |
| 127 | extern void togglemax(const char *arg); /* toggles maximization of untiled client */ | 128 | extern void togglemax(const char *arg); /* toggles maximization of floating client */ |
| 128 | extern void untile(void); /* arranges all windows untiled */ | ||
| 129 | extern void zoom(const char *arg); /* zooms the focused client to master area, arg is ignored */ | 129 | extern void zoom(const char *arg); /* zooms the focused client to master area, arg is ignored */ |
| 130 | 130 | ||
| 131 | /* main.c */ | 131 | /* main.c */ |
| @@ -151,14 +151,14 @@ buttonpress(XEvent *e) { | |||
| 151 | focus(c); | 151 | focus(c); |
| 152 | if(CLEANMASK(ev->state) != MODKEY) | 152 | if(CLEANMASK(ev->state) != MODKEY) |
| 153 | return; | 153 | return; |
| 154 | if(ev->button == Button1 && (lt->arrange == untile || c->isuntiled)) { | 154 | if(ev->button == Button1 && (lt->arrange == floating || c->isfloating)) { |
| 155 | restack(); | 155 | restack(); |
| 156 | movemouse(c); | 156 | movemouse(c); |
| 157 | } | 157 | } |
| 158 | else if(ev->button == Button2) | 158 | else if(ev->button == Button2) |
| 159 | zoom(NULL); | 159 | zoom(NULL); |
| 160 | else if(ev->button == Button3 | 160 | else if(ev->button == Button3 |
| 161 | && (lt->arrange == untile || c->isuntiled) && !c->isfixed) | 161 | && (lt->arrange == floating || c->isfloating) && !c->isfixed) |
| 162 | { | 162 | { |
| 163 | restack(); | 163 | restack(); |
| 164 | resizemouse(c); | 164 | resizemouse(c); |
| @@ -176,7 +176,7 @@ configurerequest(XEvent *e) { | |||
| 176 | c->ismax = False; | 176 | c->ismax = False; |
| 177 | if(ev->value_mask & CWBorderWidth) | 177 | if(ev->value_mask & CWBorderWidth) |
| 178 | c->border = ev->border_width; | 178 | c->border = ev->border_width; |
| 179 | if(c->isfixed || c->isuntiled || (lt->arrange == untile)) { | 179 | if(c->isfixed || c->isfloating || (lt->arrange == floating)) { |
| 180 | if(ev->value_mask & CWX) | 180 | if(ev->value_mask & CWX) |
| 181 | c->x = ev->x; | 181 | c->x = ev->x; |
| 182 | if(ev->value_mask & CWY) | 182 | if(ev->value_mask & CWY) |
| @@ -304,7 +304,7 @@ propertynotify(XEvent *e) { | |||
| 304 | default: break; | 304 | default: break; |
| 305 | case XA_WM_TRANSIENT_FOR: | 305 | case XA_WM_TRANSIENT_FOR: |
| 306 | XGetTransientForHint(dpy, c->win, &trans); | 306 | XGetTransientForHint(dpy, c->win, &trans); |
| 307 | if(!c->isuntiled && (c->isuntiled = (getclient(trans) != NULL))) | 307 | if(!c->isfloating && (c->isfloating = (getclient(trans) != NULL))) |
| 308 | lt->arrange(); | 308 | lt->arrange(); |
| 309 | break; | 309 | break; |
| 310 | case XA_WM_NORMAL_HINTS: | 310 | case XA_WM_NORMAL_HINTS: |
| @@ -31,7 +31,7 @@ tile(void) { | |||
| 31 | if(c->isbanned) | 31 | if(c->isbanned) |
| 32 | XMoveWindow(dpy, c->win, c->x, c->y); | 32 | XMoveWindow(dpy, c->win, c->x, c->y); |
| 33 | c->isbanned = False; | 33 | c->isbanned = False; |
| 34 | if(c->isuntiled) | 34 | if(c->isfloating) |
| 35 | continue; | 35 | continue; |
| 36 | c->ismax = False; | 36 | c->ismax = False; |
| 37 | nx = wax; | 37 | nx = wax; |
| @@ -70,6 +70,29 @@ LAYOUTS | |||
| 70 | /* extern */ | 70 | /* extern */ |
| 71 | 71 | ||
| 72 | void | 72 | void |
| 73 | floating(void) { | ||
| 74 | Client *c; | ||
| 75 | |||
| 76 | for(c = clients; c; c = c->next) { | ||
| 77 | if(isvisible(c)) { | ||
| 78 | if(c->isbanned) | ||
| 79 | XMoveWindow(dpy, c->win, c->x, c->y); | ||
| 80 | c->isbanned = False; | ||
| 81 | resize(c, c->x, c->y, c->w, c->h, True); | ||
| 82 | } | ||
| 83 | else { | ||
| 84 | c->isbanned = True; | ||
| 85 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | ||
| 86 | } | ||
| 87 | } | ||
| 88 | if(!sel || !isvisible(sel)) { | ||
| 89 | for(c = stack; c && !isvisible(c); c = c->snext); | ||
| 90 | focus(c); | ||
| 91 | } | ||
| 92 | restack(); | ||
| 93 | } | ||
| 94 | |||
| 95 | void | ||
| 73 | focusclient(const char *arg) { | 96 | focusclient(const char *arg) { |
| 74 | Client *c; | 97 | Client *c; |
| 75 | 98 | ||
| @@ -144,7 +167,7 @@ initlayouts(void) { | |||
| 144 | 167 | ||
| 145 | Client * | 168 | Client * |
| 146 | nexttiled(Client *c) { | 169 | nexttiled(Client *c) { |
| 147 | for(; c && (c->isuntiled || !isvisible(c)); c = c->next); | 170 | for(; c && (c->isfloating || !isvisible(c)); c = c->next); |
| 148 | return c; | 171 | return c; |
| 149 | } | 172 | } |
| 150 | 173 | ||
| @@ -156,10 +179,10 @@ restack(void) { | |||
| 156 | drawstatus(); | 179 | drawstatus(); |
| 157 | if(!sel) | 180 | if(!sel) |
| 158 | return; | 181 | return; |
| 159 | if(sel->isuntiled || lt->arrange == untile) | 182 | if(sel->isfloating || lt->arrange == floating) |
| 160 | XRaiseWindow(dpy, sel->win); | 183 | XRaiseWindow(dpy, sel->win); |
| 161 | if(lt->arrange != untile) { | 184 | if(lt->arrange != floating) { |
| 162 | if(!sel->isuntiled) | 185 | if(!sel->isfloating) |
| 163 | XLowerWindow(dpy, sel->win); | 186 | XLowerWindow(dpy, sel->win); |
| 164 | for(c = nexttiled(clients); c; c = nexttiled(c->next)) { | 187 | for(c = nexttiled(clients); c; c = nexttiled(c->next)) { |
| 165 | if(c == sel) | 188 | if(c == sel) |
| @@ -198,7 +221,7 @@ void | |||
| 198 | togglemax(const char *arg) { | 221 | togglemax(const char *arg) { |
| 199 | XEvent ev; | 222 | XEvent ev; |
| 200 | 223 | ||
| 201 | if(!sel || (lt->arrange != untile && !sel->isuntiled) || sel->isfixed) | 224 | if(!sel || (lt->arrange != floating && !sel->isfloating) || sel->isfixed) |
| 202 | return; | 225 | return; |
| 203 | if((sel->ismax = !sel->ismax)) { | 226 | if((sel->ismax = !sel->ismax)) { |
| 204 | sel->rx = sel->x; | 227 | sel->rx = sel->x; |
| @@ -214,34 +237,11 @@ togglemax(const char *arg) { | |||
| 214 | } | 237 | } |
| 215 | 238 | ||
| 216 | void | 239 | void |
| 217 | untile(void) { | ||
| 218 | Client *c; | ||
| 219 | |||
| 220 | for(c = clients; c; c = c->next) { | ||
| 221 | if(isvisible(c)) { | ||
| 222 | if(c->isbanned) | ||
| 223 | XMoveWindow(dpy, c->win, c->x, c->y); | ||
| 224 | c->isbanned = False; | ||
| 225 | resize(c, c->x, c->y, c->w, c->h, True); | ||
| 226 | } | ||
| 227 | else { | ||
| 228 | c->isbanned = True; | ||
| 229 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | ||
| 230 | } | ||
| 231 | } | ||
| 232 | if(!sel || !isvisible(sel)) { | ||
| 233 | for(c = stack; c && !isvisible(c); c = c->snext); | ||
| 234 | focus(c); | ||
| 235 | } | ||
| 236 | restack(); | ||
| 237 | } | ||
| 238 | |||
| 239 | void | ||
| 240 | zoom(const char *arg) { | 240 | zoom(const char *arg) { |
| 241 | unsigned int n; | 241 | unsigned int n; |
| 242 | Client *c; | 242 | Client *c; |
| 243 | 243 | ||
| 244 | if(!sel || lt->arrange != tile || sel->isuntiled) | 244 | if(!sel || lt->arrange != tile || sel->isfloating) |
| 245 | return; | 245 | return; |
| 246 | for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) | 246 | for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) |
| 247 | n++; | 247 | n++; |
| @@ -12,7 +12,7 @@ | |||
| 12 | typedef struct { | 12 | typedef struct { |
| 13 | const char *prop; | 13 | const char *prop; |
| 14 | const char *tags; | 14 | const char *tags; |
| 15 | Bool isuntiled; | 15 | Bool isfloating; |
| 16 | } Rule; | 16 | } Rule; |
| 17 | 17 | ||
| 18 | typedef struct { | 18 | typedef struct { |
| @@ -83,7 +83,7 @@ settags(Client *c, Client *trans) { | |||
| 83 | ch.res_name ? ch.res_name : "", c->name); | 83 | ch.res_name ? ch.res_name : "", c->name); |
| 84 | for(i = 0; i < nrules; i++) | 84 | for(i = 0; i < nrules; i++) |
| 85 | if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) { | 85 | if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) { |
| 86 | c->isuntiled = rule[i].isuntiled; | 86 | c->isfloating = rule[i].isfloating; |
| 87 | for(j = 0; regs[i].tagregex && j < ntags; j++) { | 87 | for(j = 0; regs[i].tagregex && j < ntags; j++) { |
| 88 | if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) { | 88 | if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) { |
| 89 | matched = True; | 89 | matched = True; |
