On 10 December 2011 03:07, Connor Lane Smith <c...@lubutu.com> wrote:
> So here are two patches, which implement two possible alternatives. It
> would be great if we could apply one of them to tip.

I was reminded that some people use a newfangled input device known as
the 'mouse'. New patches attached which handle mouse focus as well as
keyboard.

cls
diff -r 40bff70c312f dwm.c
--- a/dwm.c	Tue Nov 15 20:16:58 2011 +0100
+++ b/dwm.c	Sat Dec 10 03:17:42 2011 +0100
@@ -861,6 +861,7 @@
 	else
 		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
 	selmon->sel = c;
+	restack(selmon);
 	drawbars();
 }
 
@@ -1413,24 +1414,12 @@
 
 void
 restack(Monitor *m) {
-	Client *c;
 	XEvent ev;
-	XWindowChanges wc;
 
 	drawbar(m);
 	if(!m->sel)
 		return;
-	if(m->sel->isfloating || !m->lt[m->sellt]->arrange)
-		XRaiseWindow(dpy, m->sel->win);
-	if(m->lt[m->sellt]->arrange) {
-		wc.stack_mode = Below;
-		wc.sibling = m->barwin;
-		for(c = m->stack; c; c = c->snext)
-			if(!c->isfloating && ISVISIBLE(c)) {
-				XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
-				wc.sibling = c->win;
-			}
-	}
+	XRaiseWindow(dpy, m->sel->win);
 	XSync(dpy, False);
 	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
 }
@@ -2117,9 +2106,6 @@
 zoom(const Arg *arg) {
 	Client *c = selmon->sel;
 
-	if(!selmon->lt[selmon->sellt]->arrange
-	|| (selmon->sel && selmon->sel->isfloating))
-		return;
 	if(c == nexttiled(selmon->clients))
 		if(!c || !(c = nexttiled(c->next)))
 			return;
diff -r 40bff70c312f dwm.c
--- a/dwm.c	Tue Nov 15 20:16:58 2011 +0100
+++ b/dwm.c	Sat Dec 10 03:20:53 2011 +0100
@@ -861,6 +861,7 @@
 	else
 		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
 	selmon->sel = c;
+	restack(selmon);
 	drawbars();
 }
 
@@ -1420,8 +1421,6 @@
 	drawbar(m);
 	if(!m->sel)
 		return;
-	if(m->sel->isfloating || !m->lt[m->sellt]->arrange)
-		XRaiseWindow(dpy, m->sel->win);
 	if(m->lt[m->sellt]->arrange) {
 		wc.stack_mode = Below;
 		wc.sibling = m->barwin;
@@ -1431,6 +1430,7 @@
 				wc.sibling = c->win;
 			}
 	}
+	XRaiseWindow(dpy, m->sel->win);
 	XSync(dpy, False);
 	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
 }
@@ -2117,9 +2117,6 @@
 zoom(const Arg *arg) {
 	Client *c = selmon->sel;
 
-	if(!selmon->lt[selmon->sellt]->arrange
-	|| (selmon->sel && selmon->sel->isfloating))
-		return;
 	if(c == nexttiled(selmon->clients))
 		if(!c || !(c = nexttiled(c->next)))
 			return;

Reply via email to