mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
Merge pull request #49 into master (fix warp patch)
This commit is contained in:
commit
8536aa52c4
2
dwm.c
2
dwm.c
@ -2780,7 +2780,7 @@ restack(Monitor *m)
|
|||||||
(m->lt[m->sellt]->arrange != &monocle
|
(m->lt[m->sellt]->arrange != &monocle
|
||||||
&& !(m->ltaxis[MASTER] == MONOCLE && (abs(m->ltaxis[LAYOUT] == NO_SPLIT || !m->nmaster || n <= m->nmaster))))
|
&& !(m->ltaxis[MASTER] == MONOCLE && (abs(m->ltaxis[LAYOUT] == NO_SPLIT || !m->nmaster || n <= m->nmaster))))
|
||||||
#elif MONOCLE_LAYOUT
|
#elif MONOCLE_LAYOUT
|
||||||
m->lt[m->sellt]->arrange == &monocle
|
m->lt[m->sellt]->arrange != &monocle
|
||||||
#else
|
#else
|
||||||
!(m->ltaxis[MASTER] == MONOCLE && (abs(m->ltaxis[LAYOUT] == NO_SPLIT || !m->nmaster || n <= m->nmaster)))
|
!(m->ltaxis[MASTER] == MONOCLE && (abs(m->ltaxis[LAYOUT] == NO_SPLIT || !m->nmaster || n <= m->nmaster)))
|
||||||
#endif // FLEXTILE_DELUXE_LAYOUT
|
#endif // FLEXTILE_DELUXE_LAYOUT
|
||||||
|
16
patch/warp.c
16
patch/warp.c
@ -1,6 +1,8 @@
|
|||||||
void
|
void
|
||||||
warp(const Client *c)
|
warp(const Client *c)
|
||||||
{
|
{
|
||||||
|
Monitor *m;
|
||||||
|
Bar *bar;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
if (!c) {
|
if (!c) {
|
||||||
@ -12,13 +14,17 @@ warp(const Client *c)
|
|||||||
(x > c->x - c->bw &&
|
(x > c->x - c->bw &&
|
||||||
y > c->y - c->bw &&
|
y > c->y - c->bw &&
|
||||||
x < c->x + c->w + c->bw*2 &&
|
x < c->x + c->w + c->bw*2 &&
|
||||||
y < c->y + c->h + c->bw*2) ||
|
y < c->y + c->h + c->bw*2)
|
||||||
x < c->mon->wx ||
|
|
||||||
x > c->mon->wx + c->mon->ww ||
|
|
||||||
y < c->mon->wy ||
|
|
||||||
y > c->mon->wy + c->mon->wh
|
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
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);
|
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user