From 34ed78d7afb008b9c53a7f10e99df9acc324aeeb Mon Sep 17 00:00:00 2001 From: cancel Date: Tue, 11 Dec 2018 03:35:28 +0900 Subject: [PATCH] Add workaround for mouse position reporting problems --- tui_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tui_main.c b/tui_main.c index b92926e..a7003b3 100644 --- a/tui_main.c +++ b/tui_main.c @@ -1039,6 +1039,12 @@ void app_mouse_event(App_state* a, Usz vis_y, Usz vis_x, mmask_t mouse_bstate) { // only when needed, otherwise some terminals will send movement updates // when we don't want them. printf("\033[?1003h\n"); + // need to do this or double clicking can cause terminal state to get + // corrupted, since we're bypassing curses here. might cause flicker. + // wish i could figure out why report mouse position isn't working on its + // own. + fflush(stdout); + wclear(stdscr); a->is_mouse_down = true; a->tui_cursor.y = y; a->tui_cursor.x = x;