From ace6a88285a281b1d5590ab64d83be962419d976 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 17 Jan 2022 04:52:00 +0000 Subject: [PATCH] Really eliminate tooltip flicker on Haiku * src/haikufns.c (tip_frame): Make non-static. * src/haikuterm.c (haiku_read_socket): Ignore motion events that didn't actually move when a tip frame is visible. * src/haikuterm.h (tip_frame): Declare. --- src/haikufns.c | 2 +- src/haikuterm.c | 10 ++++++++++ src/haikuterm.h | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/haikufns.c b/src/haikufns.c index 52bb13bc89b..2edf883b9cb 100644 --- a/src/haikufns.c +++ b/src/haikufns.c @@ -45,7 +45,7 @@ along with GNU Emacs. If not, see . */ #define BLUE_FROM_ULONG(color) ((color) & 0xff) /* The frame of the currently visible tooltip. */ -static Lisp_Object tip_frame; +Lisp_Object tip_frame; /* The window-system window corresponding to the frame of the currently visible tooltip. */ diff --git a/src/haikuterm.c b/src/haikuterm.c index 05f9788f184..cc4c3961ec4 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -2786,6 +2786,16 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) struct haiku_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); struct haiku_rect r = dpyinfo->last_mouse_glyph; + /* For an unknown reason Haiku sends phantom motion events when a + tooltip frame is visible. FIXME */ + if (FRAMEP (tip_frame) + && FRAME_LIVE_P (XFRAME (tip_frame)) + && FRAME_VISIBLE_P (XFRAME (tip_frame)) + && f == dpyinfo->last_mouse_motion_frame + && b->x == dpyinfo->last_mouse_motion_x + && b->y == dpyinfo->last_mouse_motion_y) + continue; + dpyinfo->last_mouse_motion_x = b->x; dpyinfo->last_mouse_motion_y = b->y; dpyinfo->last_mouse_motion_frame = f; diff --git a/src/haikuterm.h b/src/haikuterm.h index 3e39403ab4d..de302883e48 100644 --- a/src/haikuterm.h +++ b/src/haikuterm.h @@ -178,6 +178,8 @@ struct x_output extern struct haiku_display_info *x_display_list; extern struct font_driver const haikufont_driver; +extern Lisp_Object tip_frame; + struct scroll_bar { /* These fields are shared by all vectors. */ -- 2.39.2