summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2022-02-27 14:59:55 +0000
committerokan <okan>2022-02-27 14:59:55 +0000
commit4e73ce533c98c54a83fa24c71105bbb1b40a0803 (patch)
tree48b09bbd6122970eeb51a0f3d3094dd9c61cfdc1
parent496bcc879de1186e62bac6fbeff531dbdc9e871c (diff)
downloadcwm-4e73ce533c98c54a83fa24c71105bbb1b40a0803.tar.gz
cwm-4e73ce533c98c54a83fa24c71105bbb1b40a0803.tar.xz
cwm-4e73ce533c98c54a83fa24c71105bbb1b40a0803.zip
cycling fix: when no client is active, warp pointer to last active;
from Walter Alejandro Iglesias.
-rw-r--r--kbfunc.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/kbfunc.c b/kbfunc.c
index 2f8d95d..f805360 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -450,7 +450,16 @@ kbfunc_client_cycle(void *ctx, struct cargs *cargs)
 		newcc->ptr.x = newcc->geom.w / 2;
 		newcc->ptr.y = newcc->geom.h / 2;
 	}
-	client_ptr_warp(newcc);
+
+	/* When no client is active, warp pointer to last active. */
+	if (oldcc->flags & (CLIENT_ACTIVE))
+		client_ptr_warp(newcc);
+	else if (oldcc->flags & (CLIENT_SKIP_CYCLE))
+		client_ptr_warp(newcc);
+	else {
+		client_raise(oldcc);
+		client_ptr_warp(oldcc);
+	}
 }
 
 void