about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--Makefile3
-rw-r--r--README17
-rw-r--r--client.c6
-rw-r--r--config.mk24
-rw-r--r--dwm.124
-rw-r--r--dwm.h8
-rw-r--r--event.c14
-rw-r--r--tag.c4
8 files changed, 42 insertions, 58 deletions
diff --git a/Makefile b/Makefile
index da0d71c..77f75e6 100644
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,6 @@ all: options dwm
 
 options:
 	@echo dwm build options:
-	@echo "LIBS     = ${LIBS}"
 	@echo "CFLAGS   = ${CFLAGS}"
 	@echo "LDFLAGS  = ${LDFLAGS}"
 	@echo "CC       = ${CC}"
@@ -29,7 +28,7 @@ dwm: ${OBJ}
 	@${CC} -o $@ ${OBJ} ${LDFLAGS}
 
 clean:
-	rm -f dwm *.o core dwm-${VERSION}.tar.gz
+	rm -f dwm *.o dwm-${VERSION}.tar.gz
 
 dist: clean
 	mkdir -p dwm-${VERSION}
diff --git a/README b/README
index 89f7dba..f7721cf 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
 dwm - dynamic window manager
 ----------------------------
-dwm is an extremly fast, small, and dynamic X11 window manager.
+dwm is an extremely fast, small, and dynamic X11 window manager.
 
 
 Requirements
@@ -10,8 +10,8 @@ In order to build dwm you need the Xlib header files.
 
 Installation
 ------------
-Edit config.mk to match your local setup. dwm is installed into
-the /usr/local namespace by default.
+Edit config.mk to match your local setup (dwm is installed into
+the /usr/local namespace by default).
 
 Afterwards enter the following command to build and install dwm (if
 necessary as root):
@@ -35,16 +35,17 @@ This will start dwm on display :1 of the host foo.bar.
 
 Displaying status info
 ----------------------
-In order to display status info in the bar, you can do following
-in .xinitrc:
+In order to display status info in the bar, you can do something
+like this in your .xinitrc:
 
     while true
     do
         echo `date` `uptime | sed 's/.*://; s/,//g'`
-        sleep 2
+        sleep 1
     done | dwm
 
+
 Configuration
 -------------
-The configuration of dwm is done by customizing source code,
-grep for CUSTOMIZE keyword.
+The configuration of dwm is done by customizing its source code
+(grep for the CUSTOMIZE keyword).
diff --git a/client.c b/client.c
index 45acf2e..646bcc1 100644
--- a/client.c
+++ b/client.c
@@ -244,11 +244,11 @@ manage(Window w, XWindowAttributes *wa)
 	c->next = clients;
 	clients = c;
 
-	XGrabButton(dpy, Button1, MODKEY, c->win, False, ButtonPressMask,
+	XGrabButton(dpy, Button1, MODKEY, c->win, False, ButtonMask,
 			GrabModeAsync, GrabModeSync, None, None);
-	XGrabButton(dpy, Button2, MODKEY, c->win, False, ButtonPressMask,
+	XGrabButton(dpy, Button2, MODKEY, c->win, False, ButtonMask,
 			GrabModeAsync, GrabModeSync, None, None);
-	XGrabButton(dpy, Button3, MODKEY, c->win, False, ButtonPressMask,
+	XGrabButton(dpy, Button3, MODKEY, c->win, False, ButtonMask,
 			GrabModeAsync, GrabModeSync, None, None);
 
 	if(!c->isfloat)
diff --git a/config.mk b/config.mk
index 605f462..d4ae17e 100644
--- a/config.mk
+++ b/config.mk
@@ -7,24 +7,18 @@ MANPREFIX = ${PREFIX}/share/man
 X11INC = /usr/X11R6/include
 X11LIB = /usr/X11R6/lib
 
-VERSION = 0.5
-
 # includes and libs
-LIBS = -L${PREFIX}/lib -L/usr/lib -lc -L${X11LIB} -lX11
+INCS = -I/usr/lib -I${X11INC}
+LIBS = -L/usr/lib -lc -L${X11LIB} -lX11
 
-# Linux/BSD
-CFLAGS = -O3 -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \
-	-DVERSION=\"${VERSION}\"
+# flags
+CFLAGS = -O3 ${INCS} -DVERSION=\"${VERSION}\"
 LDFLAGS = ${LIBS}
-#CFLAGS = -g -Wall -O2 -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \
-#	-DVERSION=\"${VERSION}\"
+#CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\"
 #LDFLAGS = -g ${LIBS}
 
-
-# Solaris
-#CFLAGS = -fast -xtarget=ultra ${INCLUDES} -DVERSION=\"${VERSION}\"
-#LIBS += -lnsl -lsocket
-
-AR = ar cr
+# compiler
 CC = cc
-RANLIB = ranlib
+
+# dwm version
+VERSION = 0.6
diff --git a/dwm.1 b/dwm.1
index a023d4a..3f1f75a 100644
--- a/dwm.1
+++ b/dwm.1
@@ -21,7 +21,7 @@ time. But each window may contain more than one tag, which makes it visible in
 several views.
 .P
 .B dwm
-consists of a small status bar which reads the text displayed from standard
+has a small status bar which reads the text displayed from standard
 input, if written. It draws 1-pixel borders around windows to indicate the
 focus state. Unfocused windows contain a small bar in front of the window
 displaying the tags and the window title.
@@ -56,14 +56,12 @@ Focus
 tag
 .TP
 .B Mod1-space
-(Re-)arrange
-.B all
-windows tiled
-.TP
-.B Mod1-Shift-space
-(Re-)arrange
-.B all
-windows floating
+Toggle between
+.B tiled
+and
+.B floating
+mode (affects
+.BR "all windows" )
 .TP
 .B Mod1-Shift-[0..n]
 Apply
@@ -79,14 +77,6 @@ Quit
 Start
 .B terminal
 .TP
-.B Mod1-Shift-w
-Start
-.B web browser
-.TP
-.B Mod1-Shift-l
-Lock
-.B screen
-.TP
 .B Mod1-Control-[0..n]
 Append
 .B nth
diff --git a/dwm.h b/dwm.h
index d18ef20..bcdb4e3 100644
--- a/dwm.h
+++ b/dwm.h
@@ -25,9 +25,12 @@ enum { Tfnord, Tdev, Tnet, Twork, Tmisc, TLast };
 
 /* END CUSTOMIZE */
 
+/* mask shorthands, used in event.c and client.c */
+#define ButtonMask	(ButtonPressMask | ButtonReleaseMask)
+#define MouseMask	(ButtonMask | PointerMotionMask)
+
 typedef union Arg Arg;
 typedef struct Client Client;
-typedef enum Corner Corner;
 typedef struct DC DC;
 typedef struct Fnt Fnt;
 
@@ -43,7 +46,8 @@ enum { WMProtocols, WMDelete, WMLast };
 /* cursor */
 enum { CurNormal, CurResize, CurMove, CurLast };
 
-enum Corner { TopLeft, TopRight, BotLeft, BotRight };
+/* windowcorners */
+typedef enum { TopLeft, TopRight, BotLeft, BotRight } Corner;
 
 struct Fnt {
 	int ascent;
diff --git a/event.c b/event.c
index 285b37e..17be71d 100644
--- a/event.c
+++ b/event.c
@@ -8,9 +8,6 @@
 #include <X11/keysym.h>
 #include <X11/Xatom.h>
 
-#define ButtonMask      (ButtonPressMask | ButtonReleaseMask)
-#define MouseMask       (ButtonMask | PointerMotionMask)
-
 /* CUSTOMIZE */
 
 typedef struct {
@@ -20,17 +17,13 @@ typedef struct {
 	Arg arg;
 } Key;
 
-/*
 const char *browse[] = { "firefox", NULL };
 const char *gimp[] = { "gimp", NULL };
-*/
-const char *term[] = { "xterm", NULL };
-/*
+const char *term[] = { /*"xterm", NULL };*/
 	"urxvt", "-tr", "+sb", "-bg", "black", "-fg", "white", "-cr", "white",
 	"-fn", "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*", NULL
 };
 const char *xlock[] = { "xlock", NULL };
-*/
 
 static Key key[] = {
 	/* modifier		key		function	arguments */
@@ -57,11 +50,9 @@ static Key key[] = {
 	{ MODKEY|ShiftMask,	XK_c,		killclient,	{ 0 } }, 
 	{ MODKEY|ShiftMask,	XK_q,		quit,		{ 0 } },
 	{ MODKEY|ShiftMask,	XK_Return,	spawn,		{ .argv = term } },
-	/*
 	{ MODKEY|ShiftMask,	XK_g,		spawn,		{ .argv = gimp } },
 	{ MODKEY|ShiftMask,	XK_l,		spawn,		{ .argv = xlock } },
 	{ MODKEY|ShiftMask,	XK_w,		spawn,		{ .argv = browse } },
-	*/
 };
 
 /* END CUSTOMIZE */
@@ -172,6 +163,7 @@ buttonpress(XEvent *e)
 		}
 	}
 	else if((c = getclient(ev->window))) {
+		focus(c);
 		switch(ev->button) {
 		default:
 			break;
@@ -247,7 +239,7 @@ enternotify(XEvent *e)
 	Client *c;
 	XCrossingEvent *ev = &e->xcrossing;
 
-	if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
+	if(ev->detail == NotifyInferior)
 		return;
 
 	if((c = getclient(ev->window)))
diff --git a/tag.c b/tag.c
index 13e22af..c42a760 100644
--- a/tag.c
+++ b/tag.c
@@ -67,6 +67,8 @@ dofloat(Arg *arg)
 			higher(sel);
 			focus(sel);
 		}
+		else
+			XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
 	}
 	drawall();
 }
@@ -130,6 +132,8 @@ dotile(Arg *arg)
 			higher(sel);
 			focus(sel);
 		}
+		else
+			XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
 	}
 	drawall();
 }
7'>627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005