[dev] [dwm] [PATCH] Focus root window on startup

From: Lukas Fleischer <suckless_AT_cryptocrack.de>
Date: Sun, 18 Aug 2013 13:36:50 +0200

It seems like we did not ensure that the root window has the input focus
when starting dwm without any clients. This led to several problems,
such as dwm being unresponsive when started from LXDM, see
https://bbs.archlinux.org/viewtopic.php?id=147693 for details.

Fix this by setting the initial input focus in setup().

Signed-off-by: Lukas Fleischer <suckless_AT_cryptocrack.de>
---
I am not entirely sure whether this is the right thing to do but it
fixes the problems mentioned in the commit message for me.
 dwm.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/dwm.c b/dwm.c
index 6f716e9..1bbb4b3 100644
--- a/dwm.c
+++ b/dwm.c
_AT_@ -1542,6 +1542,7 @@ setup(void) {
 	XChangeWindowAttributes(dpy, root, CWEventMask|CWCursor, &wa);
 	XSelectInput(dpy, root, wa.event_mask);
 	grabkeys();
+	focus(NULL);
 }
 
 void
-- 
1.8.4.rc2.477.g1da3ebd
Received on Sun Aug 18 2013 - 13:36:50 CEST

This archive was generated by hypermail 2.3.0 : Sun Aug 18 2013 - 13:48:05 CEST