about summary refs log tree commit diff stats
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/client.c b/client.c
index 5be438e..ecfd8f0 100644
--- a/client.c
+++ b/client.c
@@ -59,8 +59,6 @@ focus(Client *c)
 		drawtitle(old);
 	drawtitle(c);
 	XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
-	XSync(dpy, False);
-	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
 }
 
 void
@@ -77,8 +75,8 @@ focusnext(Arg *arg)
 	if(!(c = getnext(sel->next)))
 		c = getnext(clients);
 	if(c) {
-		higher(c);
 		focus(c);
+		restack();
 	}
 }
 
@@ -98,8 +96,8 @@ focusprev(Arg *arg)
 		c = getprev(c);
 	}
 	if(c) {
-		higher(c);
 		focus(c);
+		restack();
 	}
 }
 
@@ -181,13 +179,6 @@ gravitate(Client *c, Bool invert)
 }
 
 void
-higher(Client *c)
-{
-	XRaiseWindow(dpy, c->win);
-	XRaiseWindow(dpy, c->title);
-}
-
-void
 killclient(Arg *arg)
 {
 	if(!sel)
@@ -271,13 +262,12 @@ manage(Window w, XWindowAttributes *wa)
 			|| (c->maxw && c->minw &&
 				c->maxw == c->minw && c->maxh == c->minh);
 	settitle(c);
-	arrange(NULL);
 
-	/* mapping the window now prevents flicker */
-	XMapRaised(dpy, c->win);
-	XMapRaised(dpy, c->title);
+	XMapWindow(dpy, c->win);
+	XMapWindow(dpy, c->title);
 	if(isvisible(c))
 		focus(c);
+	arrange(NULL);
 }
 
 void
@@ -410,7 +400,7 @@ togglemax(Arg *arg)
 		sel->w = sw - 2;
 		sel->h = sh - 2 - bh;
 
-		higher(sel);
+		restack();
 		resize(sel, arrange == dofloat, TopLeft);
 
 		sel->x = ox;
@@ -446,9 +436,9 @@ unmanage(Client *c)
 	XSync(dpy, False);
 	XSetErrorHandler(xerror);
 	XUngrabServer(dpy);
-	arrange(NULL);
 	if(sel)
 		focus(sel);
+	arrange(NULL);
 }
 
 void
@@ -474,6 +464,6 @@ zoom(Arg *arg)
 	clients->prev = sel;
 	sel->next = clients;
 	clients = sel;
-	arrange(NULL);
 	focus(sel);
+	arrange(NULL);
 }
e/Makefile?h=2.5&id=d7e17087ed2fc5eed57efa03e81460e3e41f7238'>^
1076f2b
8b59083 ^
1076f2b

59b4a5e ^
dbf7e03 ^

650a1fb ^
7faa8a9 ^
650a1fb ^


dbf7e03 ^















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
                              



                                    
                                                 
                  

             
 
               

                      
       
                                




                                     



                              
             
 
           
                   
                                      

      
                                                

           
                               
                                                                              


                                                 















                                                                   
# dwm - dynamic window manager
#   (C)opyright MMVI Anselm R. Garbe

include config.mk

SRC = client.c draw.c event.c main.c tag.c util.c
OBJ = ${SRC:.c=.o}
MAN1 = dwm.1 
BIN = dwm

all: config dwm
	@echo finished

config:
	@echo dwm build options:
	@echo "LIBS     = ${LIBS}"
	@echo "CFLAGS   = ${CFLAGS}"
	@echo "LDFLAGS  = ${LDFLAGS}"
	@echo "CC       = ${CC}"

.c.o:
	@echo CC $<
	@${CC} -c ${CFLAGS} $<

${OBJ}: dwm.h

dwm: ${OBJ}
	@echo LD $@
	@${CC} -o $@ ${OBJ} ${LDFLAGS}

clean:
	rm -f dwm *.o core dwm-${VERSION}.tar.gz

dist: clean
	mkdir -p dwm-${VERSION}
	cp -R Makefile README LICENSE config.mk *.h *.c ${MAN1} dwm-${VERSION}
	tar -cf dwm-${VERSION}.tar dwm-${VERSION}
	gzip dwm-${VERSION}.tar
	rm -rf dwm-${VERSION}

install: all
	@mkdir -p ${DESTDIR}${PREFIX}/bin
	@cp -f ${BIN} ${DESTDIR}${PREFIX}/bin
	@echo installed executable files to ${DESTDIR}${PREFIX}/bin
	@mkdir -p ${DESTDIR}${MANPREFIX}/man1
	@cp -f ${MAN1} ${DESTDIR}${MANPREFIX}/man1
	@echo installed manual pages to ${DESTDIR}${MANPREFIX}/man1

uninstall:
	for i in ${BIN}; do \
		rm -f ${DESTDIR}${PREFIX}/bin/`basename $$i`; \
	done
	for i in ${MAN1}; do \
		rm -f ${DESTDIR}${MANPREFIX}/man1/`basename $$i`; \
	done