summary refs log tree commit diff
path: root/client.c
diff options
context:
space:
mode:
authorokan <okan>2020-03-24 14:47:29 +0000
committerokan <okan>2020-03-24 14:47:29 +0000
commit6c20772841684c18d85b45888de01e538f2999b4 (patch)
tree4a8c5cc0e54fe1161a1d06b260948b961444a939 /client.c
parent0a7d8cc5c4bfa8df89c7b876d9f52bea14f37014 (diff)
downloadcwm-6c20772841684c18d85b45888de01e538f2999b4.tar.gz
cwm-6c20772841684c18d85b45888de01e538f2999b4.tar.xz
cwm-6c20772841684c18d85b45888de01e538f2999b4.zip
Instead of using _NET_ACTIVE_WINDOW on restart, use the pointer location
to determine what client to set active. Reduces a round trip for every
window.
Diffstat (limited to 'client.c')
-rw-r--r--client.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/client.c b/client.c
index 21c51bc..61b2cf4 100644
--- a/client.c
+++ b/client.c
@@ -37,14 +37,11 @@ static void			 client_mwm_hints(struct client_ctx *);
 static void			 client_wm_protocols(struct client_ctx *);
 
 struct client_ctx *
-client_init(Window win, struct screen_ctx *sc, int active)
+client_init(Window win, struct screen_ctx *sc)
 {
 	struct client_ctx	*cc;
 	XWindowAttributes	 wattr;
 	int			 mapped;
-	Window			 rwin, cwin;
-	int			 x, y, wx, wy;
-	unsigned int		 mask;
 	long			 state;
 
 	if (win == None)
@@ -108,10 +105,6 @@ client_init(Window win, struct screen_ctx *sc, int active)
 		client_resize(cc, 0);
 		if (cc->initial_state)
 			xu_set_wm_state(cc->win, cc->initial_state);
-	} else {
-		if ((active == 0) && (XQueryPointer(X_Dpy, cc->win, &rwin,
-		    &cwin, &x, &y, &wx, &wy, &mask)) && (cwin != None))
-			active = 1;
 	}
 
 	XSelectInput(X_Dpy, cc->win,
@@ -152,9 +145,6 @@ out:
 	XSync(X_Dpy, False);
 	XUngrabServer(X_Dpy);
 
-	if (active)
-		client_set_active(cc);
-
 	return cc;
 }