summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@wmii.de>2006-07-15 18:51:44 +0200
committerAnselm R. Garbe <garbeam@wmii.de>2006-07-15 18:51:44 +0200
commite6cbe9c11e88537d74eb094ba5844f71ee57f268 (patch)
tree7442199183f1d55086195a3076ff000c59e13a4d
parentchanging XFlush into XSync (diff)
downloaddwm-e6cbe9c11e88537d74eb094ba5844f71ee57f268.tar.gz
dwm-e6cbe9c11e88537d74eb094ba5844f71ee57f268.zip
fixed XSync handling and finished man page
Diffstat (limited to '')
-rw-r--r--client.c7
-rw-r--r--draw.c7
-rw-r--r--dwm.158
-rw-r--r--event.c6
-rw-r--r--main.c2
5 files changed, 64 insertions, 16 deletions
diff --git a/client.c b/client.c
index 92b26a2..158b928 100644
--- a/client.c
+++ b/client.c
@@ -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
309void 308void
@@ -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);
diff --git a/draw.c b/draw.c
index 1c6613f..ec0e964 100644
--- a/draw.c
+++ b/draw.c
@@ -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
137void 137void
@@ -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
171unsigned long 170unsigned long
diff --git a/dwm.1 b/dwm.1
index 047299c..6ae2c39 100644
--- a/dwm.1
+++ b/dwm.1
@@ -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
10is a dynamic window manager for X11. 10is a dynamic window manager for X11. It consists of a small status bar at the
11top of the screen and arranges windows in either a tiled or floating mode.
12.P
13If
14.B dwm
15is in tiled mode, it consists of two columns. The left master column
16contains only one window per time, the right column contains all other windows
17in a stack. In tiled mode
18.B dwm
19.B don't
20handles incremental resizals, some terminal programs like
21.B xterm
22may not work correctly with this in tiled mode.
23.P
24If
25.B dwm
26is in floating mode, it arranges all windows with the reqyested geometry and
27allows the user to move or resize them. Some windows, like
28dialog windows, are treated floating even if
29.B dwm
30is in tiled mode. In floating mode
31.B dwm
32handles incremental resizals.
33.P
34Windows are grouped by tags. You can view all windows with a specific tag per
35time. However, each window is allowed to contain more than one tag, which
36allows to make windows visible in all views.
37.P
38.B dwm
39reads from
40.I stdin
41to display status text, if written.
42.P
43.B dwm
44draws 1-pixel borders around windows to indicate the focus state and save as
45much screen real estate as possible. Unfocused windows contain a small bar
46in 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
14prints version information to stdout, then exits. 50prints version information to
15.SS Status text 51.I stdout
52, then exits.
53.SS Customization
54.B dwm
55is customized through editing its source code. It is assumed that
56dwm users are high experienced users who know how a window manager works
57and who are able to patch
58.B dwm
59for their needs. This keeps
16.B dwm 60.B dwm
17reads from stdin to display status text if provided. 61fast, secure and simple, because it does not process any input data, except
62window 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
96Resizes current 142Resizes current
97.B window 143.B window
98while dragging 144while dragging
145.SH BUGS
146Some terminal programs do not behave correctly in tiled mode, because
147incremental resizals are ignored to use maximum screen real estate. You can
148patch the code to fix this.
diff --git a/event.c b/event.c
index 9a13eee..e948cb3 100644
--- a/event.c
+++ b/event.c
@@ -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
197static void 197static void
diff --git a/main.c b/main.c
index 5cf2738..2d132a5 100644
--- a/main.c
+++ b/main.c
@@ -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
137void 137void