summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan D <jan.h.d@swipnet.se>2010-07-01 14:20:14 +0200
committerJan D <jan.h.d@swipnet.se>2010-07-01 14:20:14 +0200
commit7a18115b47a70b38ead24ee29ec308c4f2da007f (patch)
tree81a96f6bbaa840d2a55ebe66971e2fd093f6f951 /src
parent581a81003c3fde96eacdf66d4efa144842276073 (diff)
downloademacs-7a18115b47a70b38ead24ee29ec308c4f2da007f.tar.gz
* nsfns.m (compute_tip_xy): Do not convert coordinates from frame parameters.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/nsfns.m35
2 files changed, 24 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index bd975446b3d..8a49d47b266 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
2010-07-01 Jan Djärv <jan.h.d@swipnet.se>
+ * nsfns.m (compute_tip_xy): Do not convert coordinates from frame
+ parameters, they are already absolute.
+
* nsterm.m (x_set_window_size, initFrameFromEmacs): Renamed
FRAME_NS_TOOLBAR_HEIGHT to FRAME_TOOLBAR_HEIGHT.
diff --git a/src/nsfns.m b/src/nsfns.m
index b52f839a078..01ef46a3ca1 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -2412,22 +2412,27 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y)
/* Start with user-specified or mouse position. */
left = Fcdr (Fassq (Qleft, parms));
- if (INTEGERP (left))
- pt.x = XINT (left);
- else
- pt.x = last_mouse_motion_position.x;
top = Fcdr (Fassq (Qtop, parms));
- if (INTEGERP (top))
- pt.y = XINT (top);
- else
- pt.y = last_mouse_motion_position.y;
-
- /* Convert to screen coordinates */
- pt = [view convertPoint: pt toView: nil];
- pt = [[view window] convertBaseToScreen: pt];
+ if (!INTEGERP (left) || !INTEGERP (top))
+ {
+ pt = last_mouse_motion_position;
+ /* Convert to screen coordinates */
+ pt = [view convertPoint: pt toView: nil];
+ pt = [[view window] convertBaseToScreen: pt];
+ }
+ else
+ {
+ /* Absolute coordinates. */
+ pt.x = XINT (left);
+ pt.y = x_display_pixel_height (FRAME_NS_DISPLAY_INFO (f)) - XINT (top)
+ - height;
+ }
+
/* Ensure in bounds. (Note, screen origin = lower left.) */
- if (pt.x + XINT (dx) <= 0)
+ if (INTEGERP (left))
+ *root_x = pt.x;
+ else if (pt.x + XINT (dx) <= 0)
*root_x = 0; /* Can happen for negative dx */
else if (pt.x + XINT (dx) + width
<= x_display_pixel_width (FRAME_NS_DISPLAY_INFO (f)))
@@ -2440,7 +2445,9 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y)
/* Put it left justified on the screen -- it ought to fit that way. */
*root_x = 0;
- if (pt.y - XINT (dy) - height >= 0)
+ if (INTEGERP (top))
+ *root_y = pt.y;
+ else if (pt.y - XINT (dy) - height >= 0)
/* It fits below the pointer. */
*root_y = pt.y - height - XINT (dy);
else if (pt.y + XINT (dy) + height