emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master ace6a88285: Really eliminate tooltip flicker on Haiku


From: Po Lu
Subject: master ace6a88285: Really eliminate tooltip flicker on Haiku
Date: Sun, 16 Jan 2022 23:56:01 -0500 (EST)

branch: master
commit ace6a88285a281b1d5590ab64d83be962419d976
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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 52bb13bc89..2edf883b9c 100644
--- a/src/haikufns.c
+++ b/src/haikufns.c
@@ -45,7 +45,7 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 #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 05f9788f18..cc4c3961ec 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 3e39403ab4..de302883e4 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.  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]