about summary refs log tree commit diff stats
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
parentf60c597d653bd7eab6c620fc53d732ca75f6a880 (diff)
downloaddwm-e6cbe9c11e88537d74eb094ba5844f71ee57f268.tar.gz
fixed XSync handling and finished man page
-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)
 	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
title='author Anselm R.Garbe <arg@10ksloc.org> 2006-08-11 19:26:12 +0200 committer Anselm R.Garbe <arg@10ksloc.org> 2006-08-11 19:26:12 +0200 implemented viewextend and added M-S-C-n shortcuts for extending the current view... updated man page (works great!) nice feature' href='/acidbong/suckless/dwm/commit/dwm.1?id=292ccc4c43d9529cb6db0973fcab6e24c73607a5'>292ccc4 ^
d4b7a9a ^
10885d3 ^
1836b67 ^
ee8fb0c ^
7ab8c87 ^
1836b67 ^
ee8fb0c ^
7ab8c87 ^
2b35fae ^
72655f0 ^
ee8fb0c ^
df74b26 ^
656882d ^
72655f0 ^
7a59cd1 ^




a9e145f ^








5bc4db0 ^
a9e145f ^

f22d047 ^


12ea925 ^





7b4c512 ^
12ea925 ^

20cd336 ^
12ea925 ^
39af3c2 ^
ee8fb0c ^
7ab8c87 ^
72655f0 ^
ee8fb0c ^
7ab8c87 ^
3af6434 ^
04c2657 ^
5376947 ^
04c2657 ^

5376947 ^
a355782 ^



04c2657 ^


d05d09b ^











ee8fb0c ^
5bc4db0 ^
1549faf ^
ee8fb0c ^
d05d09b ^
42fd392 ^
ee8fb0c ^
5bc4db0 ^
8dc8605 ^
ee8fb0c ^
5bc4db0 ^
1549faf ^
ee8fb0c ^
7ab8c87 ^
daae3bb ^
ee8fb0c ^
5bc4db0 ^
4bb89e2 ^
ee8fb0c ^
7ab8c87 ^
2b35fae ^
0c3544d ^
ee8fb0c ^
d05d09b ^
0e5c819 ^
ee8fb0c ^
5f55af4 ^
4bd0d33 ^
ee8fb0c ^
d05d09b ^
0c3544d ^
7ab8c87 ^
dc5c070 ^
7e98db2 ^
68b400e ^

bced907 ^
c8f96b5 ^

cba6b21 ^










124866e ^
d05d09b ^
124866e ^





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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
                      
        
                             
            
      

               
                                                                           
                                                                              
                                                              
  
                                                                              


                                                                             


                                                                           
  
                                                                           
                                                                  
  
                                                                              






                                                                               
  
                                                                    
           

      
                                                          
         

              
                     


                                                                     
   
          
                                                                              
                                                
   
          
                                                                             
   
                
                                                            
   
                
                                                                      
                     
   
                      
     
          
   




                             








                                               
                 

                                           


                       





                     
          

                    
              
                                            
   
          
                  
   
          
                      
   
          
                                          

          
                                          



                          


                          











                                                                     
                      
                                
   
                 
                                 
   
                               
                                          
   
               
                              
   
          
                              
   
                        
                                                     
   
                 
         
                  
   
                
                                                                                        
   
                
                                                        
   
                
                                                                                          
                 
                                                                            
                                            
            

              
        

                                                                                   










                                                                                           
  
                                     





                                                                                   
.TH DWM 1 dwm\-VERSION
.SH NAME
dwm \- dynamic window manager
.SH SYNOPSIS
.B dwm
.RB [ \-v ]
.SH DESCRIPTION
dwm is a dynamic window manager for X. It manages windows in tiled, monocle
and floating layouts. Either layout can be applied dynamically, optimising the
environment for the application in use and the task performed.
.P
In tiled layouts windows are managed in a master and stacking area. The master
area on the left contains one window by default, and the stacking area on the
right contains all other windows. The number of master area windows can be
adjusted from zero to an arbitrary number. In monocle layout all windows are
maximised to the screen size. In floating layout windows can be resized and
moved freely. Dialog windows are always managed floating, regardless of the
layout applied.
.P
Windows are grouped by tags. Each window can be tagged with one or multiple
tags. Selecting certain tags displays all windows with these tags.
.P
Each screen contains a small status bar which displays all available tags, the
layout, the title of the focused window, and the text read from the root window
name property, if the screen is focused. A floating window is indicated with an
empty square and a maximised floating window is indicated with a filled square
before the windows title.  The selected tags are indicated with a different
color. The tags of the focused window are indicated with a filled square in the
top left corner.  The tags which are applied to one or more windows are
indicated with an empty square in the top left corner.
.P
dwm draws a small border around windows to indicate the focus state.
.SH OPTIONS
.TP
.B \-v
prints version information to standard output, then exits.
.SH USAGE
.SS Status bar
.TP
.B X root window name
is read and displayed in the status text area. It can be set with the
.BR xsetroot (1)
command.
.TP
.B Button1
click on a tag label to display all windows with that tag, click on the layout
label toggles between tiled and floating layout.
.TP
.B Button3
click on a tag label adds/removes all windows with that tag to/from the view.
.TP
.B Mod1\-Button1
click on a tag label applies that tag to the focused window.
.TP
.B Mod1\-Button3
click on a tag label adds/removes that tag to/from the focused window.
.SS Keyboard commands
.TP
.B Mod1\-Shift\-Return
Start
.BR st(1).
.TP
.B Mod1\-p
Spawn
.BR dmenu(1)
for launching other programs.
.TP
.B Mod1\-,
Focus previous screen, if any.
.TP
.B Mod1\-.
Focus next screen, if any.
.TP
.B Mod1\-Shift\-,
Send focused window to previous screen, if any.
.TP
.B Mod1\-Shift\-.
Send focused window to next screen, if any.
.TP
.B Mod1\-b
Toggles bar on and off.
.TP
.B Mod1\-t
Sets tiled layout.
.TP
.B Mod1\-f
Sets floating layout.
.TP
.B Mod1\-m
Sets monocle layout.
.TP
.B Mod1\-space
Toggles between current and previous layout.
.TP
.B Mod1\-j
Focus next window.
.TP
.B Mod1\-k
Focus previous window.
.TP
.B Mod1\-i
Increase number of windows in master area.
.TP
.B Mod1\-d
Decrease number of windows in master area.
.TP
.B Mod1\-l
Increase master area size.
.TP
.B Mod1\-h
Decrease master area size.
.TP
.B Mod1\-Return
Zooms/cycles focused window to/from master area (tiled layouts only).
.TP
.B Mod1\-Shift\-c
Close focused window.
.TP
.B Mod1\-Shift\-space
Toggle focused window between tiled and floating state.
.TP
.B Mod1\-Tab
Toggles to the previously selected tags.
.TP
.B Mod1\-Shift\-[1..n]
Apply nth tag to focused window.
.TP
.B Mod1\-Shift\-0
Apply all tags to focused window.
.TP
.B Mod1\-Control\-Shift\-[1..n]
Add/remove nth tag to/from focused window.
.TP
.B Mod1\-[1..n]
View all windows with nth tag.
.TP
.B Mod1\-0
View all windows with any tag.
.TP
.B Mod1\-Control\-[1..n]
Add/remove all windows with nth tag to/from the view.
.TP
.B Mod1\-Shift\-q
Quit dwm.
.SS Mouse commands
.TP
.B Mod1\-Button1
Move focused window while dragging. Tiled windows will be toggled to the floating state.
.TP
.B Mod1\-Button2
Toggles focused window between floating and tiled state.
.TP
.B Mod1\-Button3
Resize focused window while dragging. Tiled windows will be toggled to the floating state.
.SH CUSTOMIZATION
dwm is customized by creating a custom config.h and (re)compiling the source
code. This keeps it fast, secure and simple.
.SH SEE ALSO
.BR dmenu (1),
.BR st (1)
.SH BUGS
Java applications which use the XToolkit/XAWT backend may draw grey windows
only. The XToolkit/XAWT backend breaks ICCCM-compliance in recent JDK 1.5 and early
JDK 1.6 versions, because it assumes a reparenting window manager. Possible workarounds
are using JDK 1.4 (which doesn't contain the XToolkit/XAWT backend) or setting the
environment variable
.BR AWT_TOOLKIT=MToolkit
(to use the older Motif backend instead) or running
.B xprop -root -f _NET_WM_NAME 32a -set _NET_WM_NAME LG3D
or
.B wmname LG3D
(to pretend that a non-reparenting window manager is running that the
XToolkit/XAWT backend can recognize) or when using OpenJDK setting the environment variable
.BR _JAVA_AWT_WM_NONREPARENTING=1 .
.P
GTK 2.10.9+ versions contain a broken
.BR Save\-As
file dialog implementation,
which requests to reconfigure its window size in an endless loop. However, its
window is still respondable during this state, so you can simply ignore the flicker
until a new GTK version appears, which will fix this bug, approximately
GTK 2.10.12+ versions.