Fix screen not being refreshed immediately after moving a window. Fixes #397

This commit is contained in:
Kovid Goyal 2018-03-16 22:00:57 +05:30
parent 16e77d7329
commit 773f26b61d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 5 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;