diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-09-29 17:44:32 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-09-29 17:44:32 +0000 |
| commit | 5171abb188b2e4a34e265b1316484400870e0b43 (patch) | |
| tree | 45c614975be6755d5d1dfbe78f4e64f1920abe8c | |
| parent | Merge branch 'reflow-retain-scrollback-position' into master (diff) | |
| parent | changelog: multiplier: the option belongs to the ‘scrollback’ section (diff) | |
Merge branch 'trackpad-scroll-speed' into master
Closes #144
| -rw-r--r-- | CHANGELOG.md | 14 | ||||
| -rw-r--r-- | config.c | 2 | ||||
| -rw-r--r-- | doc/foot.ini.5.scd | 2 | ||||
| -rw-r--r-- | foot.ini | 2 | ||||
| -rw-r--r-- | input.c | 12 |
5 files changed, 25 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index a2b30c01..89f0de13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,11 @@ ## Unreleased ### Added ### Changed + +* Default value of the **scrollback.multiplier** option in `foot.ini` + from `1.0` to `3.0`. + + ### Deprecated ### Removed ### Fixed @@ -29,6 +34,15 @@ (https://codeberg.org/dnkl/foot/issues/141). * Scrollback position is now retained when resizing the window (https://codeberg.org/dnkl/foot/issues/142). +* Trackpad scrolling speed. Note that it is much slower compared to + previous foot versions. Use the **multiplier** option in `foot.ini` + if you find the new speed too slow + (https://codeberg.org/dnkl/foot/issues/144). +* Trackpad scrolling speed to better match the mouse scrolling speed, + and to be consistent with other (Wayland) terminal emulators. Note + that it is (much) slower compared to previous foot versions. Use the + **multiplier** option in `foot.ini` if you find the new speed too + slow (https://codeberg.org/dnkl/foot/issues/144). ### Security @@ -1869,7 +1869,7 @@ config_load(struct config *conf, const char *conf_path, .format = SCROLLBACK_INDICATOR_FORMAT_TEXT, .text = wcsdup(L""), }, - .multiplier = 1., + .multiplier = 3., }, .colors = { .fg = default_foreground, diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd index 7467d0b8..e51a5470 100644 --- a/doc/foot.ini.5.scd +++ b/doc/foot.ini.5.scd @@ -99,7 +99,7 @@ in this order: *multiplier* Amount to multiply mouse scrolling with. It is a decimal number, - i.e. fractions are allowed. Default: _1.0_. + i.e. fractions are allowed. Default: _3.0_. *indicator-position* Configures the style of the scrollback position indicator. One of @@ -12,7 +12,7 @@ [scrollback] # lines=1000 -# multiplier=1.0 +# multiplier=3.0 # indicator-position=relative # indicator-format= @@ -1688,6 +1688,8 @@ wl_pointer_axis(void *data, struct wl_pointer *wl_pointer, if (seat->mouse.have_discrete) return; + assert(seat->mouse_focus != NULL); + /* * Aggregate scrolled amount until we get at least 1.0 * @@ -1697,10 +1699,12 @@ wl_pointer_axis(void *data, struct wl_pointer *wl_pointer, seat->mouse.axis_aggregated += seat->wayl->conf->scrollback.multiplier * wl_fixed_to_double(value); - if (fabs(seat->mouse.axis_aggregated) >= 1.) { - mouse_scroll(seat, round(seat->mouse.axis_aggregated)); - seat->mouse.axis_aggregated = 0.; - } + if (fabs(seat->mouse.axis_aggregated) < seat->mouse_focus->cell_height) + return; + + int lines = seat->mouse.axis_aggregated / seat->mouse_focus->cell_height; + mouse_scroll(seat, lines); + seat->mouse.axis_aggregated -= (double)lines * seat->mouse_focus->cell_height; } static void |
