about summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2020-03-20 12:13:20 +0000
committerokan <okan>2020-03-20 12:13:20 +0000
commit207b71ef1ca478e81fa812e6a1a757e98ac9a344 (patch)
tree8e7eb0be89f70409fcdfb5735647e125c22f6b8c
parent3b9b98c024dc0100af3a0700d8057b2ea96a6714 (diff)
downloadcwm-207b71ef1ca478e81fa812e6a1a757e98ac9a344.tar.gz
cwm-207b71ef1ca478e81fa812e6a1a757e98ac9a344.tar.xz
cwm-207b71ef1ca478e81fa812e6a1a757e98ac9a344.zip
No need to lookup current client early; move to right before it is
needed.
-rw-r--r--kbfunc.c4
1 files changed, 1 insertions, 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);
 	}