diff options
| author | Alan Third | 2017-05-25 20:13:21 +0100 |
|---|---|---|
| committer | Alan Third | 2017-05-25 21:50:49 +0100 |
| commit | 2ea4b84f5ee41e633430eef6b4a907dd8d0ce2ed (patch) | |
| tree | 14959834f40683f9cbfade14fc8462abef4e21eb | |
| parent | 9fb9e4b284aaf75f206e875c3fb4da8fa6085d93 (diff) | |
| download | emacs-2ea4b84f5ee41e633430eef6b4a907dd8d0ce2ed.tar.gz emacs-2ea4b84f5ee41e633430eef6b4a907dd8d0ce2ed.zip | |
Fix NS tooltips showing in the wrong place (bug#27053)
* src/nsfns.m (compute_tip_xy): Get current mouse position instead of
last recorded position.
| -rw-r--r-- | src/nsfns.m | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/nsfns.m b/src/nsfns.m index 3833ee75ac2..a69e44bb227 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -2729,8 +2729,6 @@ compute_tip_xy (struct frame *f, | |||
| 2729 | int *root_y) | 2729 | int *root_y) |
| 2730 | { | 2730 | { |
| 2731 | Lisp_Object left, top, right, bottom; | 2731 | Lisp_Object left, top, right, bottom; |
| 2732 | EmacsView *view = FRAME_NS_VIEW (f); | ||
| 2733 | struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); | ||
| 2734 | NSPoint pt; | 2732 | NSPoint pt; |
| 2735 | NSScreen *screen; | 2733 | NSScreen *screen; |
| 2736 | 2734 | ||
| @@ -2742,22 +2740,7 @@ compute_tip_xy (struct frame *f, | |||
| 2742 | 2740 | ||
| 2743 | if ((!INTEGERP (left) && !INTEGERP (right)) | 2741 | if ((!INTEGERP (left) && !INTEGERP (right)) |
| 2744 | || (!INTEGERP (top) && !INTEGERP (bottom))) | 2742 | || (!INTEGERP (top) && !INTEGERP (bottom))) |
| 2745 | { | 2743 | pt = [NSEvent mouseLocation]; |
| 2746 | pt.x = dpyinfo->last_mouse_motion_x; | ||
| 2747 | pt.y = dpyinfo->last_mouse_motion_y; | ||
| 2748 | /* Convert to screen coordinates */ | ||
| 2749 | pt = [view convertPoint: pt toView: nil]; | ||
| 2750 | #if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 | ||
| 2751 | pt = [[view window] convertBaseToScreen: pt]; | ||
| 2752 | #else | ||
| 2753 | { | ||
| 2754 | NSRect r = NSMakeRect (pt.x, pt.y, 0, 0); | ||
| 2755 | r = [[view window] convertRectToScreen: r]; | ||
| 2756 | pt.x = r.origin.x; | ||
| 2757 | pt.y = r.origin.y; | ||
| 2758 | } | ||
| 2759 | #endif | ||
| 2760 | } | ||
| 2761 | else | 2744 | else |
| 2762 | { | 2745 | { |
| 2763 | /* Absolute coordinates. */ | 2746 | /* Absolute coordinates. */ |