dwm-meillo

changeset 160:c8db0a825775

applied Sanders patches (numlock2)
author arg@10ksloc.org
date Wed, 02 Aug 2006 11:13:32 +0200
parents a5eab6aaf859
children f381e34158d9
files config.arg.h config.h config.mk dwm.1 event.c
diffstat 5 files changed, 40 insertions(+), 26 deletions(-) [+]
line diff
     1.1 --- a/config.arg.h	Wed Aug 02 10:48:58 2006 +0200
     1.2 +++ b/config.arg.h	Wed Aug 02 11:13:32 2006 +0200
     1.3 @@ -3,9 +3,7 @@
     1.4   * See LICENSE file for license details.
     1.5   */
     1.6  
     1.7 -enum { Tfnord, Tdev, Tnet, Twork, Tmisc, TLast };
     1.8  #define DEFMODE			dotile /* dofloat */
     1.9 -#define DEFTAG			Tdev
    1.10  #define FONT			"-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*"
    1.11  #define BGCOLOR			"#0a2c2d"
    1.12  #define FGCOLOR			"#ddeeee"
    1.13 @@ -14,6 +12,7 @@
    1.14  #define NUMLOCKMASK		Mod2Mask
    1.15  #define MASTERW			52 /* percent */
    1.16  
    1.17 +enum { Tfnord, Tdev, Tnet, Twork, Tmisc, TLast };
    1.18  #define TAGS \
    1.19  char *tags[TLast] = { \
    1.20  	[Tfnord] = "fnord", \
    1.21 @@ -22,6 +21,7 @@
    1.22  	[Twork] = "work", \
    1.23  	[Tmisc] = "misc", \
    1.24  };
    1.25 +#define DEFTAG			Tdev
    1.26  
    1.27  #define KEYS \
    1.28  	const char *browse[] = { "firefox", NULL }; \
     2.1 --- a/config.h	Wed Aug 02 10:48:58 2006 +0200
     2.2 +++ b/config.h	Wed Aug 02 11:13:32 2006 +0200
     2.3 @@ -3,9 +3,7 @@
     2.4   * See LICENSE file for license details.
     2.5   */
     2.6  
     2.7 -enum { Tfnord, Tdev, Tnet, Twork, Tmisc, TLast };
     2.8  #define DEFMODE			dotile /* dofloat */
     2.9 -#define DEFTAG			Tdev
    2.10  #define FONT			"fixed"
    2.11  #define BGCOLOR			"#666699"
    2.12  #define FGCOLOR			"#eeeeee"
    2.13 @@ -14,6 +12,7 @@
    2.14  #define NUMLOCKMASK		Mod2Mask
    2.15  #define MASTERW			52 /* percent */
    2.16  
    2.17 +enum { Tfnord, Tdev, Tnet, Twork, Tmisc, TLast };
    2.18  #define TAGS \
    2.19  char *tags[TLast] = { \
    2.20  	[Tfnord] = "fnord", \
    2.21 @@ -22,6 +21,7 @@
    2.22  	[Twork] = "work", \
    2.23  	[Tmisc] = "misc", \
    2.24  };
    2.25 +#define DEFTAG			Tdev
    2.26  
    2.27  #define KEYS \
    2.28  	const char *term[] = { "xterm", NULL }; \
     3.1 --- a/config.mk	Wed Aug 02 10:48:58 2006 +0200
     3.2 +++ b/config.mk	Wed Aug 02 11:13:32 2006 +0200
     3.3 @@ -1,4 +1,10 @@
     3.4 -# Customize to fit your system
     3.5 +# dwm version
     3.6 +VERSION = 0.6
     3.7 +
     3.8 +# Customize below to fit your system
     3.9 +
    3.10 +# configheader
    3.11 +CONFIG = config.h
    3.12  
    3.13  # paths
    3.14  PREFIX = /usr/local
    3.15 @@ -11,12 +17,6 @@
    3.16  INCS = -I/usr/lib -I${X11INC}
    3.17  LIBS = -L/usr/lib -lc -L${X11LIB} -lX11
    3.18  
    3.19 -# dwm version
    3.20 -VERSION = 0.6
    3.21 -
    3.22 -# default config.h
    3.23 -CONFIG = config.h
    3.24 -
    3.25  # flags
    3.26  CFLAGS = -O3 ${INCS} -DVERSION=\"${VERSION}\" -DCONFIG=\"${CONFIG}\"
    3.27  LDFLAGS = ${LIBS}
     4.1 --- a/dwm.1	Wed Aug 02 10:48:58 2006 +0200
     4.2 +++ b/dwm.1	Wed Aug 02 11:13:32 2006 +0200
     4.3 @@ -38,13 +38,21 @@
     4.4  .B master
     4.5  column
     4.6  .TP
     4.7 +.B Mod1-h
     4.8 +Focus previous
     4.9 +.B tag
    4.10 +.TP
    4.11 +.B Mod1-j
    4.12 +Focus next
    4.13 +.B window
    4.14 +.TP
    4.15  .B Mod1-k
    4.16  Focus previous
    4.17  .B window
    4.18  .TP
    4.19 -.B Mod1-j
    4.20 +.B Mod1-l
    4.21  Focus next
    4.22 -.B window
    4.23 +.B tag
    4.24  .TP
    4.25  .B Mod1-m
    4.26  Maximize current
    4.27 @@ -52,8 +60,7 @@
    4.28  .TP
    4.29  .B Mod1-[0..n]
    4.30  Focus
    4.31 -.B nth
    4.32 -tag
    4.33 +.B nth tag
    4.34  .TP
    4.35  .B Mod1-space
    4.36  Toggle between
    4.37 @@ -65,8 +72,8 @@
    4.38  .TP
    4.39  .B Mod1-Shift-[0..n]
    4.40  Apply
    4.41 -.B nth
    4.42 -tag to current
    4.43 +.B nth tag
    4.44 +to current
    4.45  .B window
    4.46  .TP
    4.47  .B Mod1-Shift-q
    4.48 @@ -79,8 +86,8 @@
    4.49  .TP
    4.50  .B Mod1-Control-[0..n]
    4.51  Append
    4.52 -.B nth
    4.53 -tag to current
    4.54 +.B nth tag
    4.55 +to current
    4.56  .B window
    4.57  .TP
    4.58  .B Mod1-Button1
    4.59 @@ -98,5 +105,5 @@
    4.60  while dragging
    4.61  .SH CUSTOMIZATION
    4.62  .B dwm
    4.63 -is customized through editing config.h of the source code.  This keeps it fast,
    4.64 -secure and simple.
    4.65 +is customized by editing the file config.h of the source code.
    4.66 +This keeps it fast, secure and simple.
     5.1 --- a/event.c	Wed Aug 02 10:48:58 2006 +0200
     5.2 +++ b/event.c	Wed Aug 02 11:13:32 2006 +0200
     5.3 @@ -19,7 +19,7 @@
     5.4  
     5.5  KEYS
     5.6  
     5.7 -static unsigned int valid_mask =  255 &  ~(NUMLOCKMASK | LockMask);
     5.8 +#define CLEANMASK(mask) (mask & ~(NUMLOCKMASK | LockMask))
     5.9  
    5.10  static void
    5.11  movemouse(Client *c)
    5.12 @@ -229,11 +229,11 @@
    5.13  	unsigned int i;
    5.14  	KeySym keysym;
    5.15  	XKeyEvent *ev = &e->xkey;
    5.16 -	ev->state &= valid_mask;
    5.17  
    5.18  	keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
    5.19  	for(i = 0; i < len; i++)
    5.20 -		if((keysym == key[i].keysym) && ((key[i].mod & valid_mask) == ev->state)) {
    5.21 +		if(keysym == key[i].keysym &&
    5.22 +				CLEANMASK(key[i].mod) == CLEANMASK(ev->state)) {
    5.23  			if(key[i].func)
    5.24  				key[i].func(&key[i].arg);
    5.25  			return;
    5.26 @@ -335,13 +335,20 @@
    5.27  
    5.28  	for(i = 0; i < len; i++) {
    5.29  		code = XKeysymToKeycode(dpy, key[i].keysym);
    5.30 +		/* normal */
    5.31  		XUngrabKey(dpy, code, key[i].mod, root);
    5.32 -		XUngrabKey(dpy, code, key[i].mod | NUMLOCKMASK, root);
    5.33 -		XUngrabKey(dpy, code, key[i].mod | NUMLOCKMASK | LockMask, root);
    5.34  		XGrabKey(dpy, code, key[i].mod, root, True,
    5.35  				GrabModeAsync, GrabModeAsync);
    5.36 +		/* capslock */
    5.37 +		XUngrabKey(dpy, code, key[i].mod | LockMask, root);
    5.38 +		XGrabKey(dpy, code, key[i].mod | LockMask, root, True,
    5.39 +				GrabModeAsync, GrabModeAsync);
    5.40 +		/* numlock */
    5.41 +		XUngrabKey(dpy, code, key[i].mod | NUMLOCKMASK, root);
    5.42  		XGrabKey(dpy, code, key[i].mod | NUMLOCKMASK, root, True,
    5.43  				GrabModeAsync, GrabModeAsync);
    5.44 +		/* capslock & numlock */
    5.45 +		XUngrabKey(dpy, code, key[i].mod | NUMLOCKMASK | LockMask, root);
    5.46  		XGrabKey(dpy, code, key[i].mod | NUMLOCKMASK | LockMask, root, True,
    5.47  				GrabModeAsync, GrabModeAsync);
    5.48  	}