Skip to content

Instantly share code, notes, and snippets.

@aaronjensen
Created May 25, 2017 19:37
Show Gist options
  • Save aaronjensen/a5f8824e82afc2dcb12bba04ddf5d16a to your computer and use it in GitHub Desktop.
Save aaronjensen/a5f8824e82afc2dcb12bba04ddf5d16a to your computer and use it in GitHub Desktop.
From 4edade12422f7dc147e7de540f447e2f779508c3 Mon Sep 17 00:00:00 2001
From: Alan Third <[email protected]>
Date: Thu, 25 May 2017 20:13:21 +0100
Subject: [PATCH] Fix NS tooltip's showing in the wrong place (bug#27053)
* src/nsfns.m (compute_tip_xy): Get current mouse position instead of
last recorded position.
---
src/nsfns.m | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/src/nsfns.m b/src/nsfns.m
index 3833ee75ac..f2f6a491a9 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -2742,22 +2742,7 @@ and GNUstep implementations ("distributor-specific release
if ((!INTEGERP (left) && !INTEGERP (right))
|| (!INTEGERP (top) && !INTEGERP (bottom)))
- {
- pt.x = dpyinfo->last_mouse_motion_x;
- pt.y = dpyinfo->last_mouse_motion_y;
- /* Convert to screen coordinates */
- pt = [view convertPoint: pt toView: nil];
-#if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
- pt = [[view window] convertBaseToScreen: pt];
-#else
- {
- NSRect r = NSMakeRect (pt.x, pt.y, 0, 0);
- r = [[view window] convertRectToScreen: r];
- pt.x = r.origin.x;
- pt.y = r.origin.y;
- }
-#endif
- }
+ pt = [NSEvent mouseLocation];
else
{
/* Absolute coordinates. */
--
2.12.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment