cwm-patched/patches/warp-on-movetogroup.diff

30 lines
787 B
Diff

diff --git a/group.c b/group.c
index af4c759..9c93497 100644
--- a/group.c
+++ b/group.c
@@ -152,6 +152,24 @@ group_movetogroup(struct client_ctx *cc, int idx)
{
struct screen_ctx *sc = cc->sc;
struct group_ctx *gc;
+ struct client_ctx *newcc = cc;
+
+ TAILQ_FOREACH(newcc, &sc->clientq, entry) {
+ if (newcc->gc != cc->gc)
+ continue;
+ if (newcc->flags & CLIENT_HIDDEN ||
+ newcc->flags & CLIENT_IGNORE || (newcc == cc))
+ continue;
+ break;
+ }
+ if (newcc != NULL) {
+ if (newcc->ptr.x < 0 || newcc->ptr.x > newcc->geom.w ||
+ newcc->ptr.y < 0 || newcc->ptr.y > newcc->geom.h) {
+ newcc->ptr.x = newcc->geom.w / 2;
+ newcc->ptr.y = newcc->geom.h / 2;
+ }
+ client_ptr_warp(newcc);
+ }
TAILQ_FOREACH(gc, &sc->groupq, entry) {
if (gc->num == idx) {