diff --git a/docs/changelog.rst b/docs/changelog.rst index f479ed1fb..ca521c74e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -24,6 +24,10 @@ To update |kitty|, :doc:`follow the instructions `. - Allow specifying watchers in session files and via a command line argument (:iss:`2933`) +- When in the main screen and a program grabs the mouse, do not use the scroll + wheel events to scroll the scrollback buffer, instead send them to the + program (:iss:`2939`) + 0.18.3 [2020-08-11] ------------------- diff --git a/kitty/mouse.c b/kitty/mouse.c index 191b355fe..d9439aec8 100644 --- a/kitty/mouse.c +++ b/kitty/mouse.c @@ -702,20 +702,17 @@ scroll_event(double UNUSED xoffset, double yoffset, int flags, int modifiers) { } if (s == 0) return; bool upwards = s > 0; - if (screen->linebuf == screen->main_linebuf) { - screen_history_scroll(screen, abs(s), upwards); - } else { - if (screen->modes.mouse_tracking_mode) { - int sz = encode_mouse_scroll(w, upwards, modifiers); - if (sz > 0) { - mouse_event_buf[sz] = 0; - for (s = abs(s); s > 0; s--) { - write_escape_code_to_child(screen, CSI, mouse_event_buf); - } + if (screen->modes.mouse_tracking_mode) { + int sz = encode_mouse_scroll(w, upwards, modifiers); + if (sz > 0) { + mouse_event_buf[sz] = 0; + for (s = abs(s); s > 0; s--) { + write_escape_code_to_child(screen, CSI, mouse_event_buf); } - } else { - fake_scroll(w, abs(s), upwards); } + } else { + if (screen->linebuf == screen->main_linebuf) screen_history_scroll(screen, abs(s), upwards); + else fake_scroll(w, abs(s), upwards); } }