summaryrefslogtreecommitdiff
path: root/src/nsterm.m
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-06-02 15:21:35 +0800
committerPo Lu <luangruo@yahoo.com>2022-06-02 15:21:35 +0800
commit77854b1af64a0778ab2311eebe90c643b2b6fb7b (patch)
tree739bbc7a9960b68f17acdee98e4bc2fe7b752d59 /src/nsterm.m
parent00a5bc9314cf18c8b6e3801765c832fca5f9f3f1 (diff)
downloademacs-77854b1af64a0778ab2311eebe90c643b2b6fb7b.tar.gz
emacs-77854b1af64a0778ab2311eebe90c643b2b6fb7b.tar.bz2
emacs-77854b1af64a0778ab2311eebe90c643b2b6fb7b.zip
Fix tooltip frames leaking into mouse position on NS
* src/nsterm.m (ns_mouse_position): Avoid tooltip frames and look underneath them when `drag-source'. ([EmacsView mouseDown:]): ([EmacsView mouseMoved:]): Ignore events from tip frames.
Diffstat (limited to 'src/nsterm.m')
-rw-r--r--src/nsterm.m20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index 46ce2cc5e44..a663aa73793 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -2337,10 +2337,18 @@ 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)
+ && w && [[w delegate] isKindOfClass: [EmacsTooltip class]])
+ continue;
+
if (w && [[w delegate] isKindOfClass: [EmacsView class]])
f = ((EmacsView *) [w delegate])->emacsframe;
else if (EQ (track_mouse, Qdrag_source))
break;
+
+ if (f && EQ (track_mouse, Qdrag_source)
+ && FRAME_TOOLTIP_P (f))
+ continue;
}
while (window_number > 0 && !f);
#endif
@@ -2355,6 +2363,9 @@ ns_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window,
if (!FRAME_NS_P (f))
f = NULL;
+ if (FRAME_TOOLTIP_P (f))
+ f = dpyinfo->last_mouse_frame;
+
/* While dropping, use the last mouse frame only if there is no
currently focused frame. */
if (!f && (EQ (track_mouse, Qdropping)
@@ -7095,6 +7106,9 @@ ns_create_font_panel_buttons (id target, SEL select, SEL cancel_action)
if (!emacs_event)
return;
+ if (FRAME_TOOLTIP_P (emacsframe))
+ return;
+
dpyinfo->last_mouse_frame = emacsframe;
/* Appears to be needed to prevent spurious movement events generated on
button clicks. */
@@ -7295,7 +7309,8 @@ ns_create_font_panel_buttons (id target, SEL select, SEL cancel_action)
tab_bar_p = EQ (window, emacsframe->tab_bar_window);
if (tab_bar_p)
- tab_bar_arg = handle_tab_bar_click (emacsframe, x, y, EV_UDMODIFIERS (theEvent) & down_modifier,
+ tab_bar_arg = handle_tab_bar_click (emacsframe, x, y,
+ EV_UDMODIFIERS (theEvent) & down_modifier,
EV_MODIFIERS (theEvent) | EV_UDMODIFIERS (theEvent));
}
@@ -7370,6 +7385,9 @@ ns_create_font_panel_buttons (id target, SEL select, SEL cancel_action)
NSPoint pt;
BOOL dragging;
+ if (FRAME_TOOLTIP_P (emacsframe))
+ return;
+
NSTRACE_WHEN (NSTRACE_GROUP_EVENTS, "[EmacsView mouseMoved:]");
dpyinfo->last_mouse_movement_time = EV_TIMESTAMP (e);