diff options
| author | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-16 00:47:40 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-16 00:47:40 +0200 |
| commit | 901b3ed9b7e3e4c7542797301ae2442938bcea20 (patch) | |
| tree | ea20343294992690b7044a87a0364305bef55e3f | |
| parent | fixed XSync handling and finished man page (diff) | |
| download | dwm-901b3ed9b7e3e4c7542797301ae2442938bcea20.tar.gz dwm-901b3ed9b7e3e4c7542797301ae2442938bcea20.zip | |
several additions in mouse handling ;)
Diffstat (limited to '')
| -rw-r--r-- | client.c | 13 | ||||
| -rw-r--r-- | dwm.1 | 63 | ||||
| -rw-r--r-- | dwm.h | 4 | ||||
| -rw-r--r-- | event.c | 36 | ||||
| -rw-r--r-- | tag.c | 8 |
5 files changed, 59 insertions, 65 deletions
| @@ -192,7 +192,7 @@ lower(Client *c) | |||
| 192 | void | 192 | void |
| 193 | manage(Window w, XWindowAttributes *wa) | 193 | manage(Window w, XWindowAttributes *wa) |
| 194 | { | 194 | { |
| 195 | Client *c, **l; | 195 | Client *c; |
| 196 | XSetWindowAttributes twa; | 196 | XSetWindowAttributes twa; |
| 197 | Window trans; | 197 | Window trans; |
| 198 | 198 | ||
| @@ -223,10 +223,11 @@ manage(Window w, XWindowAttributes *wa) | |||
| 223 | settitle(c); | 223 | settitle(c); |
| 224 | settags(c); | 224 | settags(c); |
| 225 | 225 | ||
| 226 | for(l = &clients; *l; l = &(*l)->next); | 226 | c->next = clients; |
| 227 | c->next = *l; /* *l == nil */ | 227 | clients = c; |
| 228 | *l = c; | ||
| 229 | 228 | ||
| 229 | XGrabButton(dpy, Button1, ControlMask, c->win, False, ButtonPressMask, | ||
| 230 | GrabModeAsync, GrabModeSync, None, None); | ||
| 230 | XGrabButton(dpy, Button1, Mod1Mask, c->win, False, ButtonPressMask, | 231 | XGrabButton(dpy, Button1, Mod1Mask, c->win, False, ButtonPressMask, |
| 231 | GrabModeAsync, GrabModeSync, None, None); | 232 | GrabModeAsync, GrabModeSync, None, None); |
| 232 | XGrabButton(dpy, Button2, Mod1Mask, c->win, False, ButtonPressMask, | 233 | XGrabButton(dpy, Button2, Mod1Mask, c->win, False, ButtonPressMask, |
| @@ -234,8 +235,8 @@ manage(Window w, XWindowAttributes *wa) | |||
| 234 | XGrabButton(dpy, Button3, Mod1Mask, c->win, False, ButtonPressMask, | 235 | XGrabButton(dpy, Button3, Mod1Mask, c->win, False, ButtonPressMask, |
| 235 | GrabModeAsync, GrabModeSync, None, None); | 236 | GrabModeAsync, GrabModeSync, None, None); |
| 236 | 237 | ||
| 237 | if(!c->dofloat) | 238 | if(!c->isfloat) |
| 238 | c->dofloat = trans | 239 | c->isfloat = trans |
| 239 | || ((c->maxw == c->minw) && (c->maxh == c->minh)); | 240 | || ((c->maxw == c->minw) && (c->maxh == c->minh)); |
| 240 | 241 | ||
| 241 | arrange(NULL); | 242 | arrange(NULL); |
| @@ -5,63 +5,44 @@ dwm \- dynamic window manager | |||
| 5 | .B dwm | 5 | .B dwm |
| 6 | .RB [ \-v ] | 6 | .RB [ \-v ] |
| 7 | .SH DESCRIPTION | 7 | .SH DESCRIPTION |
| 8 | .SS Overview | ||
| 9 | .B dwm | 8 | .B dwm |
| 10 | is a dynamic window manager for X11. It consists of a small status bar at the | 9 | is a dynamic window manager for X11. It consists of a small status bar and |
| 11 | top of the screen and arranges windows in either a tiled or floating mode. | 10 | arranges windows in either a tiled or floating mode. |
| 12 | .P | 11 | .P |
| 13 | If | 12 | In tiled mode |
| 14 | .B dwm | 13 | .B dwm |
| 15 | is in tiled mode, it consists of two columns. The left master column | 14 | manages all windows in a left master column and a right stacking column. The |
| 16 | contains only one window per time, the right column contains all other windows | 15 | master column contains a single window, the left stacking column all other |
| 17 | in a stack. In tiled mode | 16 | windows. Dialog windows are treated floating. |
| 18 | .B dwm | ||
| 19 | .B don't | ||
| 20 | handles incremental resizals, some terminal programs like | ||
| 21 | .B xterm | ||
| 22 | may not work correctly with this in tiled mode. | ||
| 23 | .P | 17 | .P |
| 24 | If | 18 | In floating mode |
| 25 | .B dwm | ||
| 26 | is in floating mode, it arranges all windows with the reqyested geometry and | ||
| 27 | allows the user to move or resize them. Some windows, like | ||
| 28 | dialog windows, are treated floating even if | ||
| 29 | .B dwm | 19 | .B dwm |
| 30 | is in tiled mode. In floating mode | 20 | manages all windows in a conventional way. They can be resized and moved freely |
| 31 | .B dwm | 21 | with the mouse. |
| 32 | handles incremental resizals. | ||
| 33 | .P | 22 | .P |
| 34 | Windows are grouped by tags. You can view all windows with a specific tag per | 23 | Windows are grouped by tags. You can view all windows with a specific tag per |
| 35 | time. However, each window is allowed to contain more than one tag, which | 24 | time. However, each window is allowed to contain more than one tag, which |
| 36 | allows to make windows visible in all views. | 25 | allows to make windows visible in all views. |
| 37 | .P | 26 | .P |
| 38 | .B dwm | 27 | .B dwm |
| 39 | reads from | 28 | reads from standard input to display status text, if written. |
| 40 | .I stdin | ||
| 41 | to display status text, if written. | ||
| 42 | .P | 29 | .P |
| 43 | .B dwm | 30 | .B dwm |
| 44 | draws 1-pixel borders around windows to indicate the focus state and save as | 31 | draws 1-pixel borders around windows to indicate the focus state and providing as |
| 45 | much screen real estate as possible. Unfocused windows contain a small bar | 32 | much screen real estate as possible. Unfocused windows contain a small bar |
| 46 | in front of the window indicating the tags and the window title. | 33 | in front of the window indicating the tags and the window title. |
| 47 | .SS Options | 34 | .SH OPTIONS |
| 48 | .TP | 35 | .TP |
| 49 | .B \-v | 36 | .B \-v |
| 50 | prints version information to | 37 | prints version information to standard output, then exits. |
| 51 | .I stdout | 38 | .SH CUSTOMIZATION |
| 52 | , then exits. | ||
| 53 | .SS Customization | ||
| 54 | .B dwm | 39 | .B dwm |
| 55 | is customized through editing its source code. It is assumed that | 40 | is customized through editing its source code. It is assumed that |
| 56 | dwm users are high experienced users who know how a window manager works | ||
| 57 | and who are able to patch | ||
| 58 | .B dwm | ||
| 59 | for their needs. This keeps | ||
| 60 | .B dwm | 41 | .B dwm |
| 61 | fast, secure and simple, because it does not process any input data, except | 42 | users know to patch it for their needs. This keeps it fast, secure and simple, |
| 62 | window properties and the status text read from | 43 | because it does not process any input data, except window properties and |
| 63 | .I stdin . | 44 | the status text read from standard input. |
| 64 | .SS Default Key Bindings | 45 | .SS Keyboard Control |
| 65 | .TP 16 | 46 | .TP 16 |
| 66 | .I Key | 47 | .I Key |
| 67 | .I Action | 48 | .I Action |
| @@ -71,7 +52,7 @@ Zoom | |||
| 71 | .B window | 52 | .B window |
| 72 | to the | 53 | to the |
| 73 | .B master | 54 | .B master |
| 74 | track | 55 | column |
| 75 | .TP | 56 | .TP |
| 76 | .B Mod1-k | 57 | .B Mod1-k |
| 77 | Focus previous | 58 | Focus previous |
| @@ -127,7 +108,7 @@ Append | |||
| 127 | .B nth | 108 | .B nth |
| 128 | tag to cureent | 109 | tag to cureent |
| 129 | .B window | 110 | .B window |
| 130 | .SS Default Mouse Bindings | 111 | .SS Mouse Control |
| 131 | .TP | 112 | .TP |
| 132 | .B Mod1-Button1 | 113 | .B Mod1-Button1 |
| 133 | Moves current | 114 | Moves current |
| @@ -142,7 +123,3 @@ Lowers current | |||
| 142 | Resizes current | 123 | Resizes current |
| 143 | .B window | 124 | .B window |
| 144 | while dragging | 125 | while dragging |
| 145 | .SH BUGS | ||
| 146 | Some terminal programs do not behave correctly in tiled mode, because | ||
| 147 | incremental resizals are ignored to use maximum screen real estate. You can | ||
| 148 | patch the code to fix this. | ||
| @@ -71,7 +71,7 @@ struct Client { | |||
| 71 | int grav; | 71 | int grav; |
| 72 | unsigned int border; | 72 | unsigned int border; |
| 73 | long flags; | 73 | long flags; |
| 74 | Bool dofloat; | 74 | Bool isfloat; |
| 75 | Window win; | 75 | Window win; |
| 76 | Window title; | 76 | Window title; |
| 77 | Client *next; | 77 | Client *next; |
| @@ -82,7 +82,7 @@ struct Rule { | |||
| 82 | const char *class; | 82 | const char *class; |
| 83 | const char *instance; | 83 | const char *instance; |
| 84 | char *tags[TLast]; | 84 | char *tags[TLast]; |
| 85 | Bool dofloat; | 85 | Bool isfloat; |
| 86 | }; | 86 | }; |
| 87 | 87 | ||
| 88 | struct Key { | 88 | struct Key { |
| @@ -14,8 +14,8 @@ | |||
| 14 | /********** CUSTOMIZE **********/ | 14 | /********** CUSTOMIZE **********/ |
| 15 | 15 | ||
| 16 | const char *term[] = { | 16 | const char *term[] = { |
| 17 | "urxvtc", "-tr", "+sb", "-bg", "black", "-fg", "white", "-fn", | 17 | "urxvtc", "-tr", "+sb", "-bg", "black", "-fg", "white", "-cr", "white", |
| 18 | "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*",NULL | 18 | "-fn", "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*", NULL |
| 19 | }; | 19 | }; |
| 20 | const char *browse[] = { "firefox", NULL }; | 20 | const char *browse[] = { "firefox", NULL }; |
| 21 | const char *xlock[] = { "xlock", NULL }; | 21 | const char *xlock[] = { "xlock", NULL }; |
| @@ -128,18 +128,34 @@ buttonpress(XEvent *e) | |||
| 128 | Client *c; | 128 | Client *c; |
| 129 | 129 | ||
| 130 | if(barwin == ev->window) { | 130 | if(barwin == ev->window) { |
| 131 | x = 0; | 131 | switch(ev->button) { |
| 132 | for(a.i = 0; a.i < TLast; a.i++) { | 132 | default: |
| 133 | x += textw(tags[a.i]); | 133 | x = 0; |
| 134 | if(ev->x < x) { | 134 | for(a.i = 0; a.i < TLast; a.i++) { |
| 135 | view(&a); | 135 | x += textw(tags[a.i]); |
| 136 | break; | 136 | if(ev->x < x) { |
| 137 | view(&a); | ||
| 138 | break; | ||
| 139 | } | ||
| 137 | } | 140 | } |
| 141 | break; | ||
| 142 | case Button4: | ||
| 143 | a.i = (tsel + 1 < TLast) ? tsel + 1 : 0; | ||
| 144 | view(&a); | ||
| 145 | break; | ||
| 146 | case Button5: | ||
| 147 | a.i = (tsel - 1 >= 0) ? tsel - 1 : TLast - 1; | ||
| 148 | view(&a); | ||
| 149 | break; | ||
| 138 | } | 150 | } |
| 139 | } | 151 | } |
| 140 | else if((c = getclient(ev->window))) { | 152 | else if((c = getclient(ev->window))) { |
| 141 | if(arrange == dotile && !c->dofloat) | 153 | if(arrange == dotile && !c->isfloat) { |
| 154 | if((ev->state & ControlMask) && (ev->button == Button1)) | ||
| 155 | zoom(NULL); | ||
| 142 | return; | 156 | return; |
| 157 | } | ||
| 158 | /* floating windows */ | ||
| 143 | higher(c); | 159 | higher(c); |
| 144 | switch(ev->button) { | 160 | switch(ev->button) { |
| 145 | default: | 161 | default: |
| @@ -297,7 +313,7 @@ propertynotify(XEvent *e) | |||
| 297 | default: break; | 313 | default: break; |
| 298 | case XA_WM_TRANSIENT_FOR: | 314 | case XA_WM_TRANSIENT_FOR: |
| 299 | XGetTransientForHint(dpy, c->win, &trans); | 315 | XGetTransientForHint(dpy, c->win, &trans); |
| 300 | if(!c->dofloat && (c->dofloat = (trans != 0))) | 316 | if(!c->isfloat && (c->isfloat = (trans != 0))) |
| 301 | arrange(NULL); | 317 | arrange(NULL); |
| 302 | break; | 318 | break; |
| 303 | case XA_WM_NORMAL_HINTS: | 319 | case XA_WM_NORMAL_HINTS: |
| @@ -17,7 +17,7 @@ char *tags[TLast] = { | |||
| 17 | }; | 17 | }; |
| 18 | 18 | ||
| 19 | static Rule rule[] = { | 19 | static Rule rule[] = { |
| 20 | /* class instance tags dofloat */ | 20 | /* class instance tags isfloat */ |
| 21 | { "Firefox-bin", "Gecko", { [Twww] = "www" }, False }, | 21 | { "Firefox-bin", "Gecko", { [Twww] = "www" }, False }, |
| 22 | }; | 22 | }; |
| 23 | 23 | ||
| @@ -67,7 +67,7 @@ dotile(Arg *arg) | |||
| 67 | w = sw - mw; | 67 | w = sw - mw; |
| 68 | arrange = dotile; | 68 | arrange = dotile; |
| 69 | for(n = 0, c = clients; c; c = c->next) | 69 | for(n = 0, c = clients; c; c = c->next) |
| 70 | if(c->tags[tsel] && !c->dofloat) | 70 | if(c->tags[tsel] && !c->isfloat) |
| 71 | n++; | 71 | n++; |
| 72 | 72 | ||
| 73 | if(n > 1) | 73 | if(n > 1) |
| @@ -77,7 +77,7 @@ dotile(Arg *arg) | |||
| 77 | 77 | ||
| 78 | for(i = 0, c = clients; c; c = c->next) { | 78 | for(i = 0, c = clients; c; c = c->next) { |
| 79 | if(c->tags[tsel]) { | 79 | if(c->tags[tsel]) { |
| 80 | if(c->dofloat) { | 80 | if(c->isfloat) { |
| 81 | higher(c); | 81 | higher(c); |
| 82 | resize(c, True); | 82 | resize(c, True); |
| 83 | continue; | 83 | continue; |
| @@ -155,7 +155,7 @@ settags(Client *c) | |||
| 155 | { | 155 | { |
| 156 | for(j = 0; j < TLast; j++) | 156 | for(j = 0; j < TLast; j++) |
| 157 | c->tags[j] = rule[i].tags[j]; | 157 | c->tags[j] = rule[i].tags[j]; |
| 158 | c->dofloat = rule[i].dofloat; | 158 | c->isfloat = rule[i].isfloat; |
| 159 | matched = True; | 159 | matched = True; |
| 160 | break; | 160 | break; |
| 161 | } | 161 | } |
