aboutsummarylogtreecommitdiffstats
path: root/x.c
diff options
context:
space:
mode:
authorAvi Halachmi (:avih)2019-10-10 23:42:30 +0300
committerHiltjo Posthuma2019-10-13 21:46:31 +0200
commit1ce971d058f178fe161077522e439d614c904832 (patch)
tree086789f66e84ff18dbd2d9c51fabb60a584c04bf /x.c
parent3fc2e77f31762e78b0c6e8685c5d5f2c7b3e05be (diff)
downloadaur-1ce971d058f178fe161077522e439d614c904832.tar.gz
mouse shortcuts: allow override for all shortcuts
Allow forceselmod to override all mouse shortcuts rather than only selection, and rename it to forcemousemod as it's now more appropriate. This will affect mouse shortcuts which use mask other than XK_ANY_MOD. This does not affect the default behavior because the default mouse shortcuts (wheel) use XK_ANY_MOD, where forceselmod already activated the override also before this change. Previously, if a mouse shortcut was configured with a specific mod and forceselmod was held, then the shortcut did not execute unless the configured mod included forceselmod.
Diffstat (limited to 'x.c')
-rw-r--r--x.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/x.c b/x.c
index 2a05a81435f9..c967caf2cf0c 100644
--- a/x.c
+++ b/x.c
@@ -340,7 +340,7 @@ void
mousesel(XEvent *e, int done)
{
int type, seltype = SEL_REGULAR;
- uint state = e->xbutton.state & ~(Button1Mask | forceselmod);
+ uint state = e->xbutton.state & ~(Button1Mask | forcemousemod);
for (type = 1; type < LEN(selmasks); ++type) {
if (match(selmasks[type], state)) {
@@ -423,14 +423,14 @@ bpress(XEvent *e)
MouseShortcut *ms;
int snap;
- if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
+ if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) {
mousereport(e);
return;
}
for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) {
- if (e->xbutton.button == ms->button
- && match(ms->mod, e->xbutton.state)) {
+ if (e->xbutton.button == ms->button &&
+ match(ms->mod, e->xbutton.state & ~forcemousemod)) {
ms->func(&(ms->arg));
return;
}
@@ -650,7 +650,7 @@ xsetsel(char *str)
void
brelease(XEvent *e)
{
- if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
+ if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) {
mousereport(e);
return;
}
@@ -664,7 +664,7 @@ brelease(XEvent *e)
void
bmotion(XEvent *e)
{
- if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
+ if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forcemousemod)) {
mousereport(e);
return;
}