diff options
| author | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-15 18:51:44 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-15 18:51:44 +0200 |
| commit | e6cbe9c11e88537d74eb094ba5844f71ee57f268 (patch) | |
| tree | 7442199183f1d55086195a3076ff000c59e13a4d | |
| parent | changing XFlush into XSync (diff) | |
| download | dwm-e6cbe9c11e88537d74eb094ba5844f71ee57f268.tar.gz dwm-e6cbe9c11e88537d74eb094ba5844f71ee57f268.zip | |
fixed XSync handling and finished man page
Diffstat (limited to '')
| -rw-r--r-- | client.c | 7 | ||||
| -rw-r--r-- | draw.c | 7 | ||||
| -rw-r--r-- | dwm.1 | 58 | ||||
| -rw-r--r-- | event.c | 6 | ||||
| -rw-r--r-- | main.c | 2 |
5 files changed, 64 insertions, 16 deletions
| @@ -49,13 +49,12 @@ focus(Client *c) | |||
| 49 | Client *old = sel; | 49 | Client *old = sel; |
| 50 | XEvent ev; | 50 | XEvent ev; |
| 51 | 51 | ||
| 52 | XFlush(dpy); | ||
| 53 | sel = c; | 52 | sel = c; |
| 54 | if(old && old != c) | 53 | if(old && old != c) |
| 55 | drawtitle(old); | 54 | drawtitle(old); |
| 56 | drawtitle(c); | 55 | drawtitle(c); |
| 57 | XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); | 56 | XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); |
| 58 | XFlush(dpy); | 57 | XSync(dpy, False); |
| 59 | while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); | 58 | while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); |
| 60 | } | 59 | } |
| 61 | 60 | ||
| @@ -303,7 +302,7 @@ resize(Client *c, Bool inc) | |||
| 303 | e.above = None; | 302 | e.above = None; |
| 304 | e.override_redirect = False; | 303 | e.override_redirect = False; |
| 305 | XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&e); | 304 | XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&e); |
| 306 | XFlush(dpy); | 305 | XSync(dpy, False); |
| 307 | } | 306 | } |
| 308 | 307 | ||
| 309 | void | 308 | void |
| @@ -393,7 +392,7 @@ unmanage(Client *c) | |||
| 393 | 392 | ||
| 394 | free(c); | 393 | free(c); |
| 395 | 394 | ||
| 396 | XFlush(dpy); | 395 | XSync(dpy, False); |
| 397 | XSetErrorHandler(xerror); | 396 | XSetErrorHandler(xerror); |
| 398 | XUngrabServer(dpy); | 397 | XUngrabServer(dpy); |
| 399 | arrange(NULL); | 398 | arrange(NULL); |
| @@ -131,7 +131,7 @@ drawstatus() | |||
| 131 | drawtext(stext, !istile, False); | 131 | drawtext(stext, !istile, False); |
| 132 | 132 | ||
| 133 | XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0); | 133 | XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0); |
| 134 | XFlush(dpy); | 134 | XSync(dpy, False); |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | void | 137 | void |
| @@ -163,9 +163,8 @@ drawtitle(Client *c) | |||
| 163 | dc.x += dc.w; | 163 | dc.x += dc.w; |
| 164 | dc.w = textw(c->name); | 164 | dc.w = textw(c->name); |
| 165 | drawtext(c->name, !istile, True); | 165 | drawtext(c->name, !istile, True); |
| 166 | XCopyArea(dpy, dc.drawable, c->title, dc.gc, | 166 | XCopyArea(dpy, dc.drawable, c->title, dc.gc, 0, 0, c->tw, c->th, 0, 0); |
| 167 | 0, 0, c->tw, c->th, 0, 0); | 167 | XSync(dpy, False); |
| 168 | XFlush(dpy); | ||
| 169 | } | 168 | } |
| 170 | 169 | ||
| 171 | unsigned long | 170 | unsigned long |
| @@ -7,14 +7,60 @@ dwm \- dynamic window manager | |||
| 7 | .SH DESCRIPTION | 7 | .SH DESCRIPTION |
| 8 | .SS Overview | 8 | .SS Overview |
| 9 | .B dwm | 9 | .B dwm |
| 10 | is a dynamic window manager for X11. | 10 | is a dynamic window manager for X11. It consists of a small status bar at the |
| 11 | top of the screen and arranges windows in either a tiled or floating mode. | ||
| 12 | .P | ||
| 13 | If | ||
| 14 | .B dwm | ||
| 15 | is in tiled mode, it consists of two columns. The left master column | ||
| 16 | contains only one window per time, the right column contains all other windows | ||
| 17 | in a stack. In tiled mode | ||
| 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 | ||
| 24 | If | ||
| 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 | ||
| 30 | is in tiled mode. In floating mode | ||
| 31 | .B dwm | ||
| 32 | handles incremental resizals. | ||
| 33 | .P | ||
| 34 | 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 | ||
| 36 | allows to make windows visible in all views. | ||
| 37 | .P | ||
| 38 | .B dwm | ||
| 39 | reads from | ||
| 40 | .I stdin | ||
| 41 | to display status text, if written. | ||
| 42 | .P | ||
| 43 | .B dwm | ||
| 44 | draws 1-pixel borders around windows to indicate the focus state and save as | ||
| 45 | 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. | ||
| 11 | .SS Options | 47 | .SS Options |
| 12 | .TP | 48 | .TP |
| 13 | .B \-v | 49 | .B \-v |
| 14 | prints version information to stdout, then exits. | 50 | prints version information to |
| 15 | .SS Status text | 51 | .I stdout |
| 52 | , then exits. | ||
| 53 | .SS Customization | ||
| 54 | .B dwm | ||
| 55 | 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 | ||
| 16 | .B dwm | 60 | .B dwm |
| 17 | reads from stdin to display status text if provided. | 61 | fast, secure and simple, because it does not process any input data, except |
| 62 | window properties and the status text read from | ||
| 63 | .I stdin . | ||
| 18 | .SS Default Key Bindings | 64 | .SS Default Key Bindings |
| 19 | .TP 16 | 65 | .TP 16 |
| 20 | .I Key | 66 | .I Key |
| @@ -96,3 +142,7 @@ Lowers current | |||
| 96 | Resizes current | 142 | Resizes current |
| 97 | .B window | 143 | .B window |
| 98 | while dragging | 144 | 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. | ||
| @@ -73,7 +73,7 @@ movemouse(Client *c) | |||
| 73 | handler[Expose](&ev); | 73 | handler[Expose](&ev); |
| 74 | break; | 74 | break; |
| 75 | case MotionNotify: | 75 | case MotionNotify: |
| 76 | XFlush(dpy); | 76 | XSync(dpy, False); |
| 77 | c->x = ocx + (ev.xmotion.x - x1); | 77 | c->x = ocx + (ev.xmotion.x - x1); |
| 78 | c->y = ocy + (ev.xmotion.y - y1); | 78 | c->y = ocy + (ev.xmotion.y - y1); |
| 79 | resize(c, False); | 79 | resize(c, False); |
| @@ -105,7 +105,7 @@ resizemouse(Client *c) | |||
| 105 | handler[Expose](&ev); | 105 | handler[Expose](&ev); |
| 106 | break; | 106 | break; |
| 107 | case MotionNotify: | 107 | case MotionNotify: |
| 108 | XFlush(dpy); | 108 | XSync(dpy, False); |
| 109 | c->w = abs(ocx - ev.xmotion.x); | 109 | c->w = abs(ocx - ev.xmotion.x); |
| 110 | c->h = abs(ocy - ev.xmotion.y); | 110 | c->h = abs(ocy - ev.xmotion.y); |
| 111 | c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w; | 111 | c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w; |
| @@ -191,7 +191,7 @@ configurerequest(XEvent *e) | |||
| 191 | ev->value_mask &= ~CWStackMode; | 191 | ev->value_mask &= ~CWStackMode; |
| 192 | ev->value_mask |= CWBorderWidth; | 192 | ev->value_mask |= CWBorderWidth; |
| 193 | XConfigureWindow(dpy, ev->window, ev->value_mask, &wc); | 193 | XConfigureWindow(dpy, ev->window, ev->value_mask, &wc); |
| 194 | XFlush(dpy); | 194 | XSync(dpy, False); |
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | static void | 197 | static void |
| @@ -131,7 +131,7 @@ sendevent(Window w, Atom a, long value) | |||
| 131 | e.xclient.data.l[0] = value; | 131 | e.xclient.data.l[0] = value; |
| 132 | e.xclient.data.l[1] = CurrentTime; | 132 | e.xclient.data.l[1] = CurrentTime; |
| 133 | XSendEvent(dpy, w, False, NoEventMask, &e); | 133 | XSendEvent(dpy, w, False, NoEventMask, &e); |
| 134 | XFlush(dpy); | 134 | XSync(dpy, False); |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | void | 137 | void |
