From a03d7630f133d08b457a6d08b9ce2050566800ff Mon Sep 17 00:00:00 2001 From: Po Lu Date: Tue, 26 Jul 2022 16:12:06 +0800 Subject: [PATCH] Fix flicker when moving tooltips between frames during mouse drag-and-drop * src/haikufns.c (Fx_show_tip): * src/nsfns.m (Fx_show_tip): Allow sharing existing tooltip frames between any two frames. * src/xfns.c (Fx_show_tip): Allow that but only between frames on the same X display. --- src/haikufns.c | 1 - src/nsfns.m | 1 - src/xfns.c | 3 ++- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/haikufns.c b/src/haikufns.c index 67f79a31669..f3667ac2f9d 100644 --- a/src/haikufns.c +++ b/src/haikufns.c @@ -2405,7 +2405,6 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, if (!NILP (tip_frame) && FRAME_LIVE_P (XFRAME (tip_frame))) { if (FRAME_VISIBLE_P (XFRAME (tip_frame)) - && EQ (frame, tip_last_frame) && !NILP (Fequal_including_properties (tip_last_string, string)) && !NILP (Fequal (tip_last_parms, parms))) { diff --git a/src/nsfns.m b/src/nsfns.m index b0b779bd41c..433df059610 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -3292,7 +3292,6 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, if (!NILP (tip_frame) && FRAME_LIVE_P (XFRAME (tip_frame))) { if (FRAME_VISIBLE_P (XFRAME (tip_frame)) - && EQ (frame, tip_last_frame) && !NILP (Fequal_including_properties (tip_last_string, string)) && !NILP (Fequal (tip_last_parms, parms))) { diff --git a/src/xfns.c b/src/xfns.c index ce867c1619c..076cd97875a 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -8681,7 +8681,8 @@ Text larger than the specified size is clipped. */) if (!NILP (tip_frame) && FRAME_LIVE_P (XFRAME (tip_frame))) { if (FRAME_VISIBLE_P (XFRAME (tip_frame)) - && BASE_EQ (frame, tip_last_frame) + && (FRAME_X_DISPLAY (XFRAME (frame)) + == FRAME_X_DISPLAY (XFRAME (tip_last_frame))) && !NILP (Fequal_including_properties (tip_last_string, string)) && !NILP (Fequal (tip_last_parms, parms))) { -- 2.39.2