};
static void kbptr_move(const union arg *arg);
+static void kbptr_move_on(struct client *client, const union arg *arg);
static void kbptr_click(const union arg *arg);
static struct kbptr kbptr = { 0, 0, 0, 0 };
return(exists);
}
-static void kbptr_move(const union arg *arg)
+static void kbptr_move_on(struct client *client, const union arg *arg)
{
- struct client *client;
unsigned int dir;
unsigned int stepsize;
- if(!selmon || !selmon->sel) {
+ if(!client || !arg) {
return;
}
- client = selmon->sel;
dir = arg->ui & KBPTR_DMASK;
stepsize = arg->ui & KBPTR_HALFSTEP;
return;
}
+static void kbptr_move(const union arg *arg)
+{
+ if(!selmon || !selmon->sel) {
+ return;
+ }
+
+ kbptr_move_on(selmon->sel, arg);
+ return;
+}
+
static int do_button(struct client *client,
const unsigned int button,
const unsigned int pressrelease)
void setfocus(struct client *c)
{
- union arg ptr_dest;
+ union arg ptrdst = { .ui = KBPTR_CENTER };
if(!c->neverfocus) {
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
}
- ptr_dest.ui = KBPTR_CENTER;
- kbptr_move(&ptr_dest);
-
sendevent(c->win, wmatom[WMTakeFocus], NoEventMask,
wmatom[WMTakeFocus], CurrentTime, 0, 0, 0);
+ kbptr_move_on(c, &ptrdst);
+
return;
}