mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
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:
parent
77058c59e2
commit
2dfd021f8b
1
calmwm.h
1
calmwm.h
@ -424,6 +424,7 @@ void conf_bindname(struct conf *, char *, char *);
|
|||||||
void conf_unbind(struct conf *, struct keybinding *);
|
void conf_unbind(struct conf *, struct keybinding *);
|
||||||
void conf_mousebind(struct conf *, char *, char *);
|
void conf_mousebind(struct conf *, char *, char *);
|
||||||
void conf_mouseunbind(struct conf *, struct mousebinding *);
|
void conf_mouseunbind(struct conf *, struct mousebinding *);
|
||||||
|
void conf_grab_mouse(struct client_ctx *);
|
||||||
int conf_changed(char *);
|
int conf_changed(char *);
|
||||||
void conf_reload(struct conf *);
|
void conf_reload(struct conf *);
|
||||||
void conf_font(struct conf *);
|
void conf_font(struct conf *);
|
||||||
|
3
client.c
3
client.c
@ -272,8 +272,7 @@ client_setactive(struct client_ctx *cc, int fg)
|
|||||||
XInstallColormap(X_Dpy, cc->cmap);
|
XInstallColormap(X_Dpy, cc->cmap);
|
||||||
XSetInputFocus(X_Dpy, cc->win,
|
XSetInputFocus(X_Dpy, cc->win,
|
||||||
RevertToPointerRoot, CurrentTime);
|
RevertToPointerRoot, CurrentTime);
|
||||||
xu_btn_grab(cc->pwin, Mod1Mask, AnyButton);
|
conf_grab_mouse(cc);
|
||||||
xu_btn_grab(cc->pwin, ControlMask|Mod1Mask, Button1);
|
|
||||||
/*
|
/*
|
||||||
* If we're in the middle of alt-tabbing, don't change
|
* If we're in the middle of alt-tabbing, don't change
|
||||||
* the order please.
|
* the order please.
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user