From 19eacc39316879fb7008f3b71b36e52b09f3b464 Mon Sep 17 00:00:00 2001 From: okan Date: Tue, 24 Mar 2020 14:47:29 +0000 Subject: 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. --- client.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'client.c') diff --git a/client.c b/client.c index effedd8..ffb1ed1 100644 --- a/client.c +++ b/client.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: client.c,v 1.261 2020/03/16 17:50:44 tim Exp $ + * $OpenBSD: client.c,v 1.262 2020/03/24 14:47:29 okan Exp $ */ #include @@ -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; } -- cgit v1.2.3-2-gb3c3