From 207b71ef1ca478e81fa812e6a1a757e98ac9a344 Mon Sep 17 00:00:00 2001 From: okan Date: Fri, 20 Mar 2020 12:13:20 +0000 Subject: [PATCH] No need to lookup current client early; move to right before it is needed. --- kbfunc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kbfunc.c b/kbfunc.c index f26adfc..b38610f 100644 --- a/kbfunc.c +++ b/kbfunc.c @@ -515,8 +515,6 @@ kbfunc_menu_client(void *ctx, struct cargs *cargs) if (cargs->xev == CWM_XEV_BTN) mflags |= CWM_MENU_LIST; - old_cc = client_current(sc); - TAILQ_INIT(&menuq); TAILQ_FOREACH(cc, &sc->clientq, entry) { if (!all) { @@ -530,7 +528,7 @@ kbfunc_menu_client(void *ctx, struct cargs *cargs) search_match_client, search_print_client)) != NULL) { cc = (struct client_ctx *)mi->ctx; client_show(cc); - if (old_cc) + if ((old_cc = client_current(sc)) != NULL) client_ptr_save(old_cc); client_ptr_warp(cc); }