add back warp cursor
This commit is contained in:
parent
01dcf72c10
commit
a4a71d8189
30
speedwm.c
30
speedwm.c
|
@ -702,9 +702,13 @@ static void updatetitle(Client *c);
|
||||||
static void updatewindowtype(Client *c);
|
static void updatewindowtype(Client *c);
|
||||||
static void updatewmhints(Client *c);
|
static void updatewmhints(Client *c);
|
||||||
|
|
||||||
|
/* tag functions */
|
||||||
static void toggleview(const Arg *arg);
|
static void toggleview(const Arg *arg);
|
||||||
static void tag(const Arg *arg);
|
static void tag(const Arg *arg);
|
||||||
|
|
||||||
|
/* warp functions */
|
||||||
|
static void warp(const Client *c);
|
||||||
|
|
||||||
/* view functions */
|
/* view functions */
|
||||||
static void view(const Arg *arg);
|
static void view(const Arg *arg);
|
||||||
static void viewtoleft(const Arg *arg);
|
static void viewtoleft(const Arg *arg);
|
||||||
|
@ -1273,6 +1277,29 @@ attachtop(Client *c)
|
||||||
c->mon->clients = c;
|
c->mon->clients = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
warp(const Client *c)
|
||||||
|
{
|
||||||
|
int x, y;
|
||||||
|
|
||||||
|
if (!warpcursor)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!c) {
|
||||||
|
XWarpPointer(dpy, None, root, 0, 0, 0, 0, selmon->wx + selmon->ww/2, selmon->wy + selmon->wh/2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
attachstack(Client *c)
|
attachstack(Client *c)
|
||||||
{
|
{
|
||||||
|
@ -2441,6 +2468,7 @@ focusmon(const Arg *arg)
|
||||||
unfocus(selmon->sel, 0);
|
unfocus(selmon->sel, 0);
|
||||||
selmon = m;
|
selmon = m;
|
||||||
focus(NULL);
|
focus(NULL);
|
||||||
|
warp(selmon->sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -4630,7 +4658,7 @@ restack(Monitor *m)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
warp(m->sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue