summaryrefslogtreecommitdiff
path: root/src/xfns.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2001-12-21 22:55:36 +0000
committerRichard M. Stallman <rms@gnu.org>2001-12-21 22:55:36 +0000
commitd682d3df25ca4fd42416b2c7fc349431fbac9c61 (patch)
treeea0b799bcbb0a0770c3e452c448bcda8b69e2140 /src/xfns.c
parent05b855f5a5789a96275969ef71f20f6fee387f81 (diff)
downloademacs-d682d3df25ca4fd42416b2c7fc349431fbac9c61.tar.gz
emacs-d682d3df25ca4fd42416b2c7fc349431fbac9c61.tar.bz2
emacs-d682d3df25ca4fd42416b2c7fc349431fbac9c61.zip
(compute_tip_xy): If tooltip won't fit on the screen
to the left or to the right of the pointer, put it against the left screen edge.
Diffstat (limited to 'src/xfns.c')
-rw-r--r--src/xfns.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/xfns.c b/src/xfns.c
index e310c318850..c8bce15fbd6 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -11126,10 +11126,15 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y)
if (INTEGERP (left))
*root_x = XINT (left);
- else if (*root_x + XINT (dx) + width > FRAME_X_DISPLAY_INFO (f)->width)
+ else if (*root_x + XINT (dx) + width <= FRAME_X_DISPLAY_INFO (f)->width)
+ /* It fits to the right of the pointer. */
+ *root_x += XINT (dx);
+ else if (width + XINT (dx) <= *root_x)
+ /* It fits to the left of the pointer. */
*root_x -= width + XINT (dx);
else
- *root_x += XINT (dx);
+ /* Put it left-justified on the screen--it ought to fit that way. */
+ *root_x = 0;
}