aewl

changeset 79:aabebd6e61f3

fixed XSync handling and finished man page
author Anselm R. Garbe <garbeam@wmii.de>
date Sat, 15 Jul 2006 18:51:44 +0200
parents 0d71fb80b592
children 8125f908c80c
files client.c draw.c dwm.1 event.c main.c
diffstat 5 files changed, 64 insertions(+), 16 deletions(-) [+]
line diff
     1.1 --- a/client.c	Sat Jul 15 18:11:14 2006 +0200
     1.2 +++ b/client.c	Sat Jul 15 18:51:44 2006 +0200
     1.3 @@ -49,13 +49,12 @@
     1.4  	Client *old = sel;
     1.5  	XEvent ev;
     1.6  
     1.7 -	XFlush(dpy);
     1.8  	sel = c;
     1.9  	if(old && old != c)
    1.10  		drawtitle(old);
    1.11  	drawtitle(c);
    1.12  	XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
    1.13 -	XFlush(dpy);
    1.14 +	XSync(dpy, False);
    1.15  	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
    1.16  }
    1.17  
    1.18 @@ -303,7 +302,7 @@
    1.19  	e.above = None;
    1.20  	e.override_redirect = False;
    1.21  	XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&e);
    1.22 -	XFlush(dpy);
    1.23 +	XSync(dpy, False);
    1.24  }
    1.25  
    1.26  void
    1.27 @@ -393,7 +392,7 @@
    1.28  
    1.29  	free(c);
    1.30  
    1.31 -	XFlush(dpy);
    1.32 +	XSync(dpy, False);
    1.33  	XSetErrorHandler(xerror);
    1.34  	XUngrabServer(dpy);
    1.35  	arrange(NULL);
     2.1 --- a/draw.c	Sat Jul 15 18:11:14 2006 +0200
     2.2 +++ b/draw.c	Sat Jul 15 18:51:44 2006 +0200
     2.3 @@ -131,7 +131,7 @@
     2.4  	drawtext(stext, !istile, False);
     2.5  
     2.6  	XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0);
     2.7 -	XFlush(dpy);
     2.8 +	XSync(dpy, False);
     2.9  }
    2.10  
    2.11  void
    2.12 @@ -163,9 +163,8 @@
    2.13  	dc.x += dc.w;
    2.14  	dc.w = textw(c->name);
    2.15  	drawtext(c->name, !istile, True);
    2.16 -	XCopyArea(dpy, dc.drawable, c->title, dc.gc,
    2.17 -			0, 0, c->tw, c->th, 0, 0);
    2.18 -	XFlush(dpy);
    2.19 +	XCopyArea(dpy, dc.drawable, c->title, dc.gc, 0, 0, c->tw, c->th, 0, 0);
    2.20 +	XSync(dpy, False);
    2.21  }
    2.22  
    2.23  unsigned long
     3.1 --- a/dwm.1	Sat Jul 15 18:11:14 2006 +0200
     3.2 +++ b/dwm.1	Sat Jul 15 18:51:44 2006 +0200
     3.3 @@ -7,14 +7,60 @@
     3.4  .SH DESCRIPTION
     3.5  .SS Overview
     3.6  .B dwm
     3.7 -is a dynamic window manager for X11.
     3.8 +is a dynamic window manager for X11. It consists of a small status bar at the
     3.9 +top of the screen and arranges windows in either a tiled or floating mode.
    3.10 +.P
    3.11 +If 
    3.12 +.B dwm
    3.13 +is in tiled mode, it consists of two columns. The left master column
    3.14 +contains only one window per time, the right column contains all other windows 
    3.15 +in a stack. In tiled mode
    3.16 +.B dwm
    3.17 +.B don't
    3.18 +handles incremental resizals, some terminal programs like
    3.19 +.B xterm
    3.20 +may not work correctly with this in tiled mode.
    3.21 +.P
    3.22 +If
    3.23 +.B dwm
    3.24 +is in floating mode, it arranges all windows with the reqyested geometry and
    3.25 +allows the user to move or resize them. Some windows, like
    3.26 +dialog windows, are treated floating even if
    3.27 +.B dwm
    3.28 +is in tiled mode. In floating mode
    3.29 +.B dwm
    3.30 +handles incremental resizals.
    3.31 +.P
    3.32 +Windows are grouped by tags. You can view all windows with a specific tag per
    3.33 +time.  However, each window is allowed to contain more than one tag, which
    3.34 +allows to make windows visible in all views.
    3.35 +.P
    3.36 +.B dwm
    3.37 +reads from
    3.38 +.I stdin
    3.39 +to display status text, if written.
    3.40 +.P
    3.41 +.B dwm
    3.42 +draws 1-pixel borders around windows to indicate the focus state and save as
    3.43 +much screen real estate as possible. Unfocused windows contain a small bar
    3.44 +in front of the window indicating the tags and the window title.
    3.45  .SS Options
    3.46  .TP
    3.47  .B \-v
    3.48 -prints version information to stdout, then exits.
    3.49 -.SS Status text
    3.50 +prints version information to
    3.51 +.I stdout
    3.52 +, then exits.
    3.53 +.SS Customization
    3.54  .B dwm
    3.55 -reads from stdin to display status text if provided.
    3.56 +is customized through editing its source code. It is assumed that
    3.57 +dwm users are high experienced users who know how a window manager works
    3.58 +and who are able to patch
    3.59 +.B dwm
    3.60 +for their needs. This keeps
    3.61 +.B dwm
    3.62 +fast, secure and simple, because it does not process any input data, except
    3.63 +window properties and the status text read from
    3.64 +.I stdin .
    3.65  .SS Default Key Bindings
    3.66  .TP 16
    3.67  .I Key	
    3.68 @@ -96,3 +142,7 @@
    3.69  Resizes current
    3.70  .B window
    3.71  while dragging
    3.72 +.SH BUGS
    3.73 +Some terminal programs do not behave correctly in tiled mode, because
    3.74 +incremental resizals are ignored to use maximum screen real estate. You can
    3.75 +patch the code to fix this.
     4.1 --- a/event.c	Sat Jul 15 18:11:14 2006 +0200
     4.2 +++ b/event.c	Sat Jul 15 18:51:44 2006 +0200
     4.3 @@ -73,7 +73,7 @@
     4.4  			handler[Expose](&ev);
     4.5  			break;
     4.6  		case MotionNotify:
     4.7 -			XFlush(dpy);
     4.8 +			XSync(dpy, False);
     4.9  			c->x = ocx + (ev.xmotion.x - x1);
    4.10  			c->y = ocy + (ev.xmotion.y - y1);
    4.11  			resize(c, False);
    4.12 @@ -105,7 +105,7 @@
    4.13  			handler[Expose](&ev);
    4.14  			break;
    4.15  		case MotionNotify:
    4.16 -			XFlush(dpy);
    4.17 +			XSync(dpy, False);
    4.18  			c->w = abs(ocx - ev.xmotion.x);
    4.19  			c->h = abs(ocy - ev.xmotion.y);
    4.20  			c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w;
    4.21 @@ -191,7 +191,7 @@
    4.22  	ev->value_mask &= ~CWStackMode;
    4.23  	ev->value_mask |= CWBorderWidth;
    4.24  	XConfigureWindow(dpy, ev->window, ev->value_mask, &wc);
    4.25 -	XFlush(dpy);
    4.26 +	XSync(dpy, False);
    4.27  }
    4.28  
    4.29  static void
     5.1 --- a/main.c	Sat Jul 15 18:11:14 2006 +0200
     5.2 +++ b/main.c	Sat Jul 15 18:51:44 2006 +0200
     5.3 @@ -131,7 +131,7 @@
     5.4  	e.xclient.data.l[0] = value;
     5.5  	e.xclient.data.l[1] = CurrentTime;
     5.6  	XSendEvent(dpy, w, False, NoEventMask, &e);
     5.7 -	XFlush(dpy);
     5.8 +	XSync(dpy, False);
     5.9  }
    5.10  
    5.11  void