diff options
author | Christian Persch <chpe@src.gnome.org> | 2020-11-16 21:34:23 +0100 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2020-11-16 21:34:23 +0100 |
commit | cb8f16c0bd6bbd8c0675a83541c72014e5464659 (patch) | |
tree | da8f43c35f9bcbf7c420a7377103996b70dff58e /src/vte.cc | |
parent | ebda2490952c2c93e1830b2ae6bd4ef8f4ace1ec (diff) | |
download | vte-cb8f16c0bd6bbd8c0675a83541c72014e5464659.tar.gz |
widget: Add API to disable fallback scrolling
Ordinarily, when the VteTerminal hasn't consumed a scroll event otherwise
(e.g. by sending the event to the application), it falls back to perform
a history scroll. When the terminal is added to a GtkScrolledWindow, this
result in the scrolled window not performing kinetic scrolling.
This commit adds API (and GObject property) to VteTerminal to disable the
fallback scrolling.
Based on a patch by Tony Houghton <h@realh.co.uk>.
Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/234
Diffstat (limited to 'src/vte.cc')
-rw-r--r-- | src/vte.cc | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -9389,18 +9389,15 @@ Terminal::widget_mouse_scroll(vte::platform::ScrollEvent const& event) send_child({normal, normal_length}); } g_free (normal); - return true; - } else { + } else if (m_fallback_scrolling) { /* Perform a history scroll. */ double dcnt = m_screen->scroll_delta + v * m_mouse_smooth_scroll_delta; queue_adjustment_value_changed_clamped(dcnt); m_mouse_smooth_scroll_delta = 0; - return true; } - - return true; + return false; } bool @@ -9507,6 +9504,16 @@ Terminal::set_allow_hyperlink(bool setting) } bool +Terminal::set_fallback_scrolling(bool set) +{ + if (set == m_fallback_scrolling) + return false; + + m_fallback_scrolling = set; + return true; +} + +bool Terminal::set_scroll_on_output(bool scroll) { if (scroll == m_scroll_on_output) |