aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nsfns.m11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/nsfns.m b/src/nsfns.m
index 7bac2836fed..0c865070fb7 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -2752,16 +2752,19 @@ compute_tip_xy (struct frame *f,
2752 2752
2753 /* Find the screen that pt is on. */ 2753 /* Find the screen that pt is on. */
2754 for (screen in [NSScreen screens]) 2754 for (screen in [NSScreen screens])
2755#ifdef NS_IMPL_COCOA
2756 if (CGRectContainsPoint ((CGRect)[screen frame], (CGPoint)pt))
2757#else
2758 if (pt.x >= screen.frame.origin.x 2755 if (pt.x >= screen.frame.origin.x
2759 && pt.x < screen.frame.origin.x + screen.frame.size.width 2756 && pt.x < screen.frame.origin.x + screen.frame.size.width
2760 && pt.y >= screen.frame.origin.y 2757 && pt.y >= screen.frame.origin.y
2761 && pt.y < screen.frame.origin.y + screen.frame.size.height) 2758 && pt.y < screen.frame.origin.y + screen.frame.size.height)
2762#endif
2763 break; 2759 break;
2764 2760
2761 /* We could use this instead of the if above:
2762
2763 if (CGRectContainsPoint ([screen frame], pt))
2764
2765 which would be neater, but it causes problems building on old
2766 versions of macOS and in GNUstep. */
2767
2765 /* Ensure in bounds. (Note, screen origin = lower left.) */ 2768 /* Ensure in bounds. (Note, screen origin = lower left.) */
2766 if (INTEGERP (left) || INTEGERP (right)) 2769 if (INTEGERP (left) || INTEGERP (right))
2767 *root_x = pt.x; 2770 *root_x = pt.x;