[dev] [dwm] sloppy focus

2011-07-03 Thread Connor Lane Smith
Hey,

I don't know about all you, but I find dwm's sloppy focus can be
really annoying at times -- focusing a window when I accidentally
nudge my atrophying pointer -- and would rather click-to-focus. The
great thing about dropping dwm's sloppy focus is it saves 20 lines of
code! So how about we make dwm less mousy and a bit simpler, too?

Thanks,
cls
diff -r c787646ca93f dwm.c
--- a/dwm.c	Sat Jul 02 11:02:22 2011 +0200
+++ b/dwm.c	Mon Jul 04 02:03:03 2011 +0100
@@ -177,7 +177,6 @@
 static void drawbars(void);
 static void drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]);
 static void drawtext(const char *text, unsigned long col[ColLast], Bool invert);
-static void enternotify(XEvent *e);
 static void expose(XEvent *e);
 static void focus(Client *c);
 static void focusin(XEvent *e);
@@ -259,7 +258,6 @@
 	[ConfigureRequest] = configurerequest,
 	[ConfigureNotify] = configurenotify,
 	[DestroyNotify] = destroynotify,
-	[EnterNotify] = enternotify,
 	[Expose] = expose,
 	[FocusIn] = focusin,
 	[KeyPress] = keypress,
@@ -819,24 +817,6 @@
 }
 
 void
-enternotify(XEvent *e) {
-	Client *c;
-	Monitor *m;
-	XCrossingEvent *ev = e-xcrossing;
-
-	if((ev-mode != NotifyNormal || ev-detail == NotifyInferior)  ev-window != root)
-		return;
-	c = wintoclient(ev-window);
-	if((m = wintomon(ev-window))  m != selmon) {
-		unfocus(selmon-sel, True);
-		selmon = m;
-	}
-	else if(c == selmon-sel || c == NULL)
-		return;
-	focus((wintoclient(ev-window)));
-}
-
-void
 expose(XEvent *e) {
 	Monitor *m;
 	XExposeEvent *ev = e-xexpose;


Re: [dev] [dwm] sloppy focus

2011-07-03 Thread Kurt H Maier
 I don't know about all you, but I find dwm's sloppy focus can be
 really annoying at times -- focusing a window when I accidentally
 nudge my atrophying pointer -- and would rather click-to-focus. The
 great thing about dropping dwm's sloppy focus is it saves 20 lines of
 code! So how about we make dwm less mousy and a bit simpler, too?

click to focus is for macs.



-- 
# Kurt H Maier



Re: [dev] [dwm] sloppy focus

2011-07-03 Thread garbeam
Am 04.07.2011 03:11 schrieb Connor Lane Smith c...@lubutu.com:
 I don't know about all you, but I find dwm's sloppy focus can be
 really annoying at times -- focusing a window when I accidentally
 nudge my atrophying pointer -- and would rather click-to-focus. The
 great thing about dropping dwm's sloppy focus is it saves 20 lines of
 code! So how about we make dwm less mousy and a bit simpler, too?

No I totally disagree. Click to focus makes the life uneccessary harder.
Doing this just for the rare corner case of touching your pointing device by
accident doesn't sound like a very sound reason for it.

Also there are chances your patch doesn't cover all cases for click to focus
behavior correctly. In my impression the proper way would increase LOC
overall. But I need to do a detailed look at it first.

I appreciate this as a patch though.

Cheers
--garbeam