From 0307497e0642c8c0cee2eabcf415462eb3a76d20 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 16 Sep 2017 17:11:30 +0530 Subject: [PATCH] Fix broken scrolling --- kitty/keys.c | 6 +++--- kitty/window.py | 6 ------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/kitty/keys.c b/kitty/keys.c index a4520a80e..87a59c198 100644 --- a/kitty/keys.c +++ b/kitty/keys.c @@ -146,9 +146,6 @@ on_key_input(int key, int scancode, int action, int mods) { Window *w = active_window(); if (!w) return; Screen *screen = w->render_data.screen; - if (screen->scrolled_by && action == GLFW_PRESS && !is_modifier_key(key)) { - screen_history_scroll(screen, SCROLL_FULL, false); // scroll back to bottom - } int lkey = get_localized_key(key, scancode); if (action == GLFW_PRESS || action == GLFW_REPEAT) { uint16_t qkey = key_map[lkey]; @@ -168,6 +165,9 @@ on_key_input(int key, int scancode, int action, int mods) { } } } + if (screen->scrolled_by && action == GLFW_PRESS && !is_modifier_key(key)) { + screen_history_scroll(screen, SCROLL_FULL, false); // scroll back to bottom + } if ( action == GLFW_PRESS || (action == GLFW_REPEAT && screen->modes.mDECARM) || diff --git a/kitty/window.py b/kitty/window.py index 064e6a21c..a4d34bb07 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -249,30 +249,24 @@ class Window: def scroll_line_up(self): if self.screen.is_main_linebuf(): self.screen.scroll(SCROLL_LINE, True) - glfw_post_empty_event() def scroll_line_down(self): if self.screen.is_main_linebuf(): self.screen.scroll(SCROLL_LINE, False) - glfw_post_empty_event() def scroll_page_up(self): if self.screen.is_main_linebuf(): self.screen.scroll(SCROLL_PAGE, True) - glfw_post_empty_event() def scroll_page_down(self): if self.screen.is_main_linebuf(): self.screen.scroll(SCROLL_PAGE, False) - glfw_post_empty_event() def scroll_home(self): if self.screen.is_main_linebuf(): self.screen.scroll(SCROLL_FULL, True) - glfw_post_empty_event() def scroll_end(self): if self.screen.is_main_linebuf(): self.screen.scroll(SCROLL_FULL, False) - glfw_post_empty_event() # }}}