summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--macosx/tkMacOSXWm.c13
-rw-r--r--tests/unixWm.test2
2 files changed, 13 insertions, 2 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 6c7468a..e782dda 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -623,17 +623,26 @@ FrontWindowAtPoint(
for (NSWindow *w in windows) {
winPtr = TkMacOSXGetTkWindow(w);
if (winPtr) {
+ // WmInfo *wmPtr = winPtr->wmInfoPtr;
NSRect windowFrame = [w frame];
- NSRect contentFrame = windowFrame;
+ NSRect contentFrame = [w frame];
+
+ contentFrame.size.height = [[w contentView] frame].size.height;
/*
* For consistency with other platforms, points in the
* title bar are not considered to be contained in the
* window.
*/
- contentFrame.size.height = [[w contentView] frame].size.height;
if (NSMouseInRect(p, contentFrame, NO)) {
return winPtr;
+ } else if (NSMouseInRect(p, windowFrame, NO)) {
+ /*
+ * The pointer is in the title bar of the highest NSWindow
+ * containing it, and therefore is should not be considered
+ * to be contained in any Tk window.
+ */
+ return NULL;
}
}
}
diff --git a/tests/unixWm.test b/tests/unixWm.test
index 472db21..65561d4 100644
--- a/tests/unixWm.test
+++ b/tests/unixWm.test
@@ -1806,6 +1806,8 @@ test unixWm-49.2 {Tk_GetRootCoords procedure, menubars} {unix testmenubar} {
} {52 7 12 62}
deleteWindows
+# Make sure that the root window is out of the way!
+wm geom . +700+700
wm withdraw .
if {[tk windowingsystem] eq "aqua"} {
# Modern mac windows have no border.