fixed XSync handling and finished man page e6cbe9c1
Anselm R. Garbe · 2006-07-15 18:51 5 file(s) · +64 −16
client.c +3 −4
49 49
	Client *old = sel;
50 50
	XEvent ev;
51 51
52 -
	XFlush(dpy);
53 52
	sel = c;
54 53
	if(old && old != c)
55 54
		drawtitle(old);
56 55
	drawtitle(c);
57 56
	XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
58 -
	XFlush(dpy);
57 +
	XSync(dpy, False);
59 58
	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
60 59
}
61 60
303 302
	e.above = None;
304 303
	e.override_redirect = False;
305 304
	XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&e);
306 -
	XFlush(dpy);
305 +
	XSync(dpy, False);
307 306
}
308 307
309 308
void
393 392
394 393
	free(c);
395 394
396 -
	XFlush(dpy);
395 +
	XSync(dpy, False);
397 396
	XSetErrorHandler(xerror);
398 397
	XUngrabServer(dpy);
399 398
	arrange(NULL);
draw.c +3 −4
131 131
	drawtext(stext, !istile, False);
132 132
133 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 137
void
163 163
	dc.x += dc.w;
164 164
	dc.w = textw(c->name);
165 165
	drawtext(c->name, !istile, True);
166 -
	XCopyArea(dpy, dc.drawable, c->title, dc.gc,
167 -
			0, 0, c->tw, c->th, 0, 0);
168 -
	XFlush(dpy);
166 +
	XCopyArea(dpy, dc.drawable, c->title, dc.gc, 0, 0, c->tw, c->th, 0, 0);
167 +
	XSync(dpy, False);
169 168
}
170 169
171 170
unsigned long
dwm.1 +54 −4
7 7
.SH DESCRIPTION
8 8
.SS Overview
9 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 47
.SS Options
12 48
.TP
13 49
.B \-v
14 -
prints version information to stdout, then exits.
15 -
.SS Status text
50 +
prints version information to
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 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 64
.SS Default Key Bindings
19 65
.TP 16
20 66
.I Key	
96 142
Resizes current
97 143
.B window
98 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.
event.c +3 −3
73 73
			handler[Expose](&ev);
74 74
			break;
75 75
		case MotionNotify:
76 -
			XFlush(dpy);
76 +
			XSync(dpy, False);
77 77
			c->x = ocx + (ev.xmotion.x - x1);
78 78
			c->y = ocy + (ev.xmotion.y - y1);
79 79
			resize(c, False);
105 105
			handler[Expose](&ev);
106 106
			break;
107 107
		case MotionNotify:
108 -
			XFlush(dpy);
108 +
			XSync(dpy, False);
109 109
			c->w = abs(ocx - ev.xmotion.x);
110 110
			c->h = abs(ocy - ev.xmotion.y);
111 111
			c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w;
191 191
	ev->value_mask &= ~CWStackMode;
192 192
	ev->value_mask |= CWBorderWidth;
193 193
	XConfigureWindow(dpy, ev->window, ev->value_mask, &wc);
194 -
	XFlush(dpy);
194 +
	XSync(dpy, False);
195 195
}
196 196
197 197
static void
main.c +1 −1
131 131
	e.xclient.data.l[0] = value;
132 132
	e.xclient.data.l[1] = CurrentTime;
133 133
	XSendEvent(dpy, w, False, NoEventMask, &e);
134 -
	XFlush(dpy);
134 +
	XSync(dpy, False);
135 135
}
136 136
137 137
void