From 773f26b61da2edc5d8a3be61840403400c4cc4c0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 16 Mar 2018 22:00:57 +0530 Subject: [PATCH] Fix screen not being refreshed immediately after moving a window. Fixes #397 --- kitty/child-monitor.c | 3 ++- kitty/state.c | 2 ++ kitty/state.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c index 1c4533ec2..a43bd5428 100644 --- a/kitty/child-monitor.c +++ b/kitty/child-monitor.c @@ -569,7 +569,8 @@ simple_render_screen(PyObject UNUSED *self, PyObject *args) { static inline bool prepare_to_render_os_window(OSWindow *os_window, double now, unsigned int *active_window_id, color_type *active_window_bg, unsigned int *num_visible_windows) { #define TD os_window->tab_bar_render_data - bool needs_render = false; + bool needs_render = os_window->needs_render; + os_window->needs_render = false; if (TD.screen && os_window->num_tabs > 1) { if (send_cell_data_to_gpu(TD.vao_idx, 0, TD.xstart, TD.ystart, TD.dx, TD.dy, TD.screen, os_window)) needs_render = true; } diff --git a/kitty/state.c b/kitty/state.c index 28186f30b..420b188ff 100644 --- a/kitty/state.c +++ b/kitty/state.c @@ -201,6 +201,7 @@ static inline void set_active_tab(id_type os_window_id, unsigned int idx) { WITH_OS_WINDOW(os_window_id) os_window->active_tab = idx; + os_window->needs_render = true; END_WITH_OS_WINDOW } @@ -208,6 +209,7 @@ static inline void set_active_window(id_type os_window_id, id_type tab_id, unsigned int idx) { WITH_TAB(os_window_id, tab_id) tab->active_window = idx; + osw->needs_render = true; END_WITH_TAB; } diff --git a/kitty/state.h b/kitty/state.h index e88eb37d1..99191a020 100644 --- a/kitty/state.h +++ b/kitty/state.h @@ -102,7 +102,7 @@ typedef struct { double viewport_x_ratio, viewport_y_ratio; Tab *tabs; unsigned int active_tab, num_tabs, capacity, last_active_tab, last_num_tabs, last_active_window_id; - bool focused_at_last_render; + bool focused_at_last_render, needs_render; ScreenRenderData tab_bar_render_data; bool is_focused; double cursor_blink_zero_time, last_mouse_activity_at;