diff options
| author | bakkeby <[email protected]> | 2020-10-06 12:45:09 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2020-10-06 12:45:09 +0200 |
| commit | b25b92b5f447e9d0ba8bcbeec342eddb0846483f (patch) | |
| tree | e608cd421c6cdb536873b891fd2cb3aacf1dc6f6 /patch | |
| parent | 56c81ddbfa8f133d6690977f6ea01d16185538a2 (diff) | |
| download | dwm-flexipatch-b25b92b5f447e9d0ba8bcbeec342eddb0846483f.tar.gz dwm-flexipatch-b25b92b5f447e9d0ba8bcbeec342eddb0846483f.zip | |
warp: do not warp if force_warp = 1 and mouse cursor is on a bar
Diffstat (limited to 'patch')
| -rw-r--r-- | patch/warp.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/patch/warp.c b/patch/warp.c index e266656..4183818 100644 --- a/patch/warp.c +++ b/patch/warp.c @@ -13,24 +13,25 @@ warp(const Client *c) return; } - if (!force_warp) { - if (!getrootptr(&x, &y) || - (x > c->x - c->bw && - y > c->y - c->bw && - x < c->x + c->w + c->bw*2 && - y < c->y + c->h + c->bw*2) - ) - return; + if (!getrootptr(&x, &y)) + return; + + if (!force_warp && + (x > c->x - c->bw && + y > c->y - c->bw && + x < c->x + c->w + c->bw*2 && + y < c->y + c->h + c->bw*2)) + return; + + force_warp = 0; - for (m = mons; m; m = m->next) - for (bar = m->bar; bar; bar = bar->next) - if (x > bar->bx && - x < bar->bx + bar->bw && - y > bar->by && - y < bar->by + bar->bh) - return; - } else - force_warp = 0; + for (m = mons; m; m = m->next) + for (bar = m->bar; bar; bar = bar->next) + if (x > bar->bx && + x < bar->bx + bar->bw && + y > bar->by && + y < bar->by + bar->bh) + return; XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2); } |
