mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-27 01:40:16 -05:00
input: don’t apply [scrollback].multiplier when alt screen is in use
Closes #787
This commit is contained in:
parent
e026ef22f4
commit
ebcf5a4b4f
2 changed files with 13 additions and 4 deletions
|
|
@ -63,6 +63,8 @@
|
||||||
“yes|true|on|1|no|false|off|0”, Previously, anything that did not
|
“yes|true|on|1|no|false|off|0”, Previously, anything that did not
|
||||||
match “yes|true|on”, or a number greater than 0, was treated as
|
match “yes|true|on”, or a number greater than 0, was treated as
|
||||||
“false”.
|
“false”.
|
||||||
|
* `[scrollback].multiplier` is no longer applied when the alternate
|
||||||
|
screen is in use (https://codeberg.org/dnkl/foot/issues/787).
|
||||||
|
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
|
||||||
15
input.c
15
input.c
|
|
@ -2151,6 +2151,14 @@ mouse_scroll(struct seat *seat, int amount, enum wl_pointer_axis axis)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static float
|
||||||
|
mouse_scroll_multiplier(const struct terminal *term)
|
||||||
|
{
|
||||||
|
return term->grid == &term->normal
|
||||||
|
? term->conf->scrollback.multiplier
|
||||||
|
: 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
wl_pointer_axis(void *data, struct wl_pointer *wl_pointer,
|
wl_pointer_axis(void *data, struct wl_pointer *wl_pointer,
|
||||||
uint32_t time, uint32_t axis, wl_fixed_t value)
|
uint32_t time, uint32_t axis, wl_fixed_t value)
|
||||||
|
|
@ -2169,9 +2177,8 @@ wl_pointer_axis(void *data, struct wl_pointer *wl_pointer,
|
||||||
* Without this, very slow scrolling will never actually scroll
|
* Without this, very slow scrolling will never actually scroll
|
||||||
* anything.
|
* anything.
|
||||||
*/
|
*/
|
||||||
seat->mouse.aggregated[axis]
|
seat->mouse.aggregated[axis] +=
|
||||||
+= seat->wayl->conf->scrollback.multiplier * wl_fixed_to_double(value);
|
mouse_scroll_multiplier(seat->mouse_focus) * wl_fixed_to_double(value);
|
||||||
|
|
||||||
if (fabs(seat->mouse.aggregated[axis]) < seat->mouse_focus->cell_height)
|
if (fabs(seat->mouse.aggregated[axis]) < seat->mouse_focus->cell_height)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -2192,7 +2199,7 @@ wl_pointer_axis_discrete(void *data, struct wl_pointer *wl_pointer,
|
||||||
if (axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL) {
|
if (axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL) {
|
||||||
/* Treat mouse wheel left/right as regular buttons */
|
/* Treat mouse wheel left/right as regular buttons */
|
||||||
} else
|
} else
|
||||||
amount *= seat->wayl->conf->scrollback.multiplier;
|
amount *= mouse_scroll_multiplier(seat->mouse_focus);
|
||||||
|
|
||||||
mouse_scroll(seat, amount, axis);
|
mouse_scroll(seat, amount, axis);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue