From caf8a83730c82155b55b63de18e019c276dee2de Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 2 Jun 2022 15:46:42 +0800 Subject: [PATCH] Fix flickering tooltips with mouse DND without interprogram drag * src/haikuterm.c (haiku_read_socket): * src/nsterm.m (ns_mouse_position): * src/xterm.c (XTmouse_position, handle_one_xevent): Apply special tooltip treatment to `dropping' as well as `drag-source'. --- src/haikuterm.c | 6 ++++-- src/nsterm.m | 6 ++++-- src/xterm.c | 10 +++++++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/haikuterm.c b/src/haikuterm.c index d3a02ff6e52..0a994b7e605 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -3290,7 +3290,8 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) leave notification events for this. */ if (any_help_event_p - && !(EQ (track_mouse, Qdrag_source) + && !((EQ (track_mouse, Qdrag_source) + || EQ (track_mouse, Qdropping)) && gui_mouse_grabbed (x_display_list))) do_help = -1; break; @@ -3339,7 +3340,8 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) haiku_new_focus_frame (x_display_list->focused_frame); if (any_help_event_p - && !(EQ (track_mouse, Qdrag_source) + && !((EQ (track_mouse, Qdrag_source) + || EQ (track_mouse, Qdropping)) && gui_mouse_grabbed (x_display_list))) do_help = -1; } diff --git a/src/nsterm.m b/src/nsterm.m index a663aa73793..9a23efe3ac1 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -2337,7 +2337,8 @@ ns_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, belowWindowWithWindowNumber: window_number]; w = [NSApp windowWithWindowNumber: window_number]; - if (EQ (track_mouse, Qdrag_source) + if (EQ (EQ (track_mouse, Qdrag_source) + || EQ (track_mouse, Qdropping)) && w && [[w delegate] isKindOfClass: [EmacsTooltip class]]) continue; @@ -2346,7 +2347,8 @@ ns_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, else if (EQ (track_mouse, Qdrag_source)) break; - if (f && EQ (track_mouse, Qdrag_source) + if (f && (EQ (track_mouse, Qdrag_source) + || EQ (track_mouse, Qdropping)) && FRAME_TOOLTIP_P (f)) continue; } diff --git a/src/xterm.c b/src/xterm.c index cd6b6af58fe..f280fea4cb9 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -11715,7 +11715,9 @@ XTmouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, /* If CHILD is a tooltip frame, look below it if track-mouse is drag-source. */ - if (child != None) + if (child != None + && (EQ (track_mouse, Qdrag_source) + || EQ (track_mouse, Qdropping))) { maybe_tooltip = x_any_window_to_frame (dpyinfo, child); @@ -16822,7 +16824,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, /* But never if `mouse-drag-and-drop-region' is in progress, since that results in the tooltip being dismissed when the mouse moves on top. */ - && !(EQ (track_mouse, Qdrag_source) + && !((EQ (track_mouse, Qdrag_source) + || EQ (track_mouse, Qdropping)) && gui_mouse_grabbed (dpyinfo))) do_help = -1; } @@ -18163,7 +18166,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, in progress, since that results in the tooltip being dismissed when the mouse moves on top. */ - && !(EQ (track_mouse, Qdrag_source) + && !((EQ (track_mouse, Qdrag_source) + || EQ (track_mouse, Qdropping)) && gui_mouse_grabbed (dpyinfo))) do_help = -1; } -- 2.39.2