From e6cbe9c11e88537d74eb094ba5844f71ee57f268 Mon Sep 17 00:00:00 2001 From: "Anselm R. Garbe" Date: Sat, 15 Jul 2006 18:51:44 +0200 Subject: fixed XSync handling and finished man page --- client.c | 7 +++---- draw.c | 7 +++---- dwm.1 | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---- event.c | 6 +++--- main.c | 2 +- 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) Client *old = sel; XEvent ev; - XFlush(dpy); sel = c; if(old && old != c) drawtitle(old); drawtitle(c); XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); - XFlush(dpy); + XSync(dpy, False); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); } @@ -303,7 +302,7 @@ resize(Client *c, Bool inc) e.above = None; e.override_redirect = False; XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&e); - XFlush(dpy); + XSync(dpy, False); } void @@ -393,7 +392,7 @@ unmanage(Client *c) free(c); - XFlush(dpy); + XSync(dpy, False); XSetErrorHandler(xerror); XUngrabServer(dpy); 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() drawtext(stext, !istile, False); XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0); - XFlush(dpy); + XSync(dpy, False); } void @@ -163,9 +163,8 @@ drawtitle(Client *c) dc.x += dc.w; dc.w = textw(c->name); drawtext(c->name, !istile, True); - XCopyArea(dpy, dc.drawable, c->title, dc.gc, - 0, 0, c->tw, c->th, 0, 0); - XFlush(dpy); + XCopyArea(dpy, dc.drawable, c->title, dc.gc, 0, 0, c->tw, c->th, 0, 0); + XSync(dpy, False); } unsigned 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 .SH DESCRIPTION .SS Overview .B dwm -is a dynamic window manager for X11. +is a dynamic window manager for X11. It consists of a small status bar at the +top of the screen and arranges windows in either a tiled or floating mode. +.P +If +.B dwm +is in tiled mode, it consists of two columns. The left master column +contains only one window per time, the right column contains all other windows +in a stack. In tiled mode +.B dwm +.B don't +handles incremental resizals, some terminal programs like +.B xterm +may not work correctly with this in tiled mode. +.P +If +.B dwm +is in floating mode, it arranges all windows with the reqyested geometry and +allows the user to move or resize them. Some windows, like +dialog windows, are treated floating even if +.B dwm +is in tiled mode. In floating mode +.B dwm +handles incremental resizals. +.P +Windows are grouped by tags. You can view all windows with a specific tag per +time. However, each window is allowed to contain more than one tag, which +allows to make windows visible in all views. +.P +.B dwm +reads from +.I stdin +to display status text, if written. +.P +.B dwm +draws 1-pixel borders around windows to indicate the focus state and save as +much screen real estate as possible. Unfocused windows contain a small bar +in front of the window indicating the tags and the window title. .SS Options .TP .B \-v -prints version information to stdout, then exits. -.SS Status text +prints version information to +.I stdout +, then exits. +.SS Customization +.B dwm +is customized through editing its source code. It is assumed that +dwm users are high experienced users who know how a window manager works +and who are able to patch +.B dwm +for their needs. This keeps .B dwm -reads from stdin to display status text if provided. +fast, secure and simple, because it does not process any input data, except +window properties and the status text read from +.I stdin . .SS Default Key Bindings .TP 16 .I Key @@ -96,3 +142,7 @@ Lowers current Resizes current .B window while dragging +.SH BUGS +Some terminal programs do not behave correctly in tiled mode, because +incremental resizals are ignored to use maximum screen real estate. You can +patch 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) handler[Expose](&ev); break; case MotionNotify: - XFlush(dpy); + XSync(dpy, False); c->x = ocx + (ev.xmotion.x - x1); c->y = ocy + (ev.xmotion.y - y1); resize(c, False); @@ -105,7 +105,7 @@ resizemouse(Client *c) handler[Expose](&ev); break; case MotionNotify: - XFlush(dpy); + XSync(dpy, False); c->w = abs(ocx - ev.xmotion.x); c->h = abs(ocy - ev.xmotion.y); c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w; @@ -191,7 +191,7 @@ configurerequest(XEvent *e) ev->value_mask &= ~CWStackMode; ev->value_mask |= CWBorderWidth; XConfigureWindow(dpy, ev->window, ev->value_mask, &wc); - XFlush(dpy); + XSync(dpy, False); } static 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) e.xclient.data.l[0] = value; e.xclient.data.l[1] = CurrentTime; XSendEvent(dpy, w, False, NoEventMask, &e); - XFlush(dpy); + XSync(dpy, False); } void -- cgit 1.4.1-2-gfad0 74' href='#n74'>74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458