diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2005-12-19 19:57:22 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2005-12-19 19:57:22 +0000 |
commit | e93b29568add51c918892153759a1fcd440e85be (patch) | |
tree | 4ca3494b355f5df3d0cdbe155eeaa3f630f293c1 /src/macfns.c | |
parent | 8d3cdf56502e89f00e86b02f24422acfa1b34beb (diff) | |
parent | 3031d8b0bb97f21c79b3022ff3e7564173facd18 (diff) | |
download | emacs-e93b29568add51c918892153759a1fcd440e85be.tar.gz emacs-e93b29568add51c918892153759a1fcd440e85be.tar.bz2 emacs-e93b29568add51c918892153759a1fcd440e85be.zip |
Merged from miles@gnu.org--gnu-2005 (patch 169-173, 671-676)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-671
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-672
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-673
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-674
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-675
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-169
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-170
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-171
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-172
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-173
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-454
Diffstat (limited to 'src/macfns.c')
-rw-r--r-- | src/macfns.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/macfns.c b/src/macfns.c index 9d23f47b5ed..99abc643043 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -3840,16 +3840,22 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) if (INTEGERP (top)) *root_y = XINT (top); - else if (*root_y + XINT (dy) - height < 0) - *root_y -= XINT (dy); + else if (*root_y + XINT (dy) <= 0) + *root_y = 0; /* Can happen for negative dy */ + else if (*root_y + XINT (dy) + height <= FRAME_MAC_DISPLAY_INFO (f)->height) + /* It fits below the pointer */ + *root_y += XINT (dy); + else if (height + XINT (dy) <= *root_y) + /* It fits above the pointer. */ + *root_y -= height + XINT (dy); else - { - *root_y -= height; - *root_y += XINT (dy); - } + /* Put it on the top. */ + *root_y = 0; if (INTEGERP (left)) *root_x = XINT (left); + else if (*root_x + XINT (dx) <= 0) + *root_x = 0; /* Can happen for negative dx */ else if (*root_x + XINT (dx) + width <= FRAME_MAC_DISPLAY_INFO (f)->width) /* It fits to the right of the pointer. */ *root_x += XINT (dx); |