Actually grab the correct mouse buttons for a window, instead of doing the
old hardcoded ones (which now can be wrong). tested by todd@ and johan@.
This commit is contained in:
30
conf.c
30
conf.c
@@ -474,3 +474,33 @@ conf_mouseunbind(struct conf *c, struct mousebinding *unbind)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Grab the mouse buttons that we need for bindings for this client
|
||||
*/
|
||||
void
|
||||
conf_grab_mouse(struct client_ctx *cc)
|
||||
{
|
||||
struct mousebinding *mb;
|
||||
int button;
|
||||
|
||||
|
||||
TAILQ_FOREACH(mb, &Conf.mousebindingq, entry) {
|
||||
if (mb->context != MOUSEBIND_CTX_WIN)
|
||||
continue;
|
||||
|
||||
switch(mb->button) {
|
||||
case 1:
|
||||
button = Button1;
|
||||
break;
|
||||
case 2:
|
||||
button = Button2;
|
||||
break;
|
||||
case 3:
|
||||
button = Button3;
|
||||
break;
|
||||
default:
|
||||
warnx("strange button in mousebinding\n");
|
||||
}
|
||||
xu_btn_grab(cc->pwin, mb->modmask, button);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user