diff options
author | culler <culler> | 2024-05-24 15:30:48 (GMT) |
---|---|---|
committer | culler <culler> | 2024-05-24 15:30:48 (GMT) |
commit | 285f6cdbf8bad836d1de14c2dd11f7e86daeeb8e (patch) | |
tree | 41ee44fd49f6aa91206d7d9a5e0fba227900ceef /macosx/tkMacOSXWm.c | |
parent | c4c94b611dab530185007be10efece9695dcdb72 (diff) | |
download | tk-285f6cdbf8bad836d1de14c2dd11f7e86daeeb8e.zip tk-285f6cdbf8bad836d1de14c2dd11f7e86daeeb8e.tar.gz tk-285f6cdbf8bad836d1de14c2dd11f7e86daeeb8e.tar.bz2 |
Fix bug introduced in FrontWindowAtPoint which causes unixWm-50.1 to fail by ignoring that the pointer is in a titlebar. Also, make the unixWm-50 tests more robust by ensuring that the root window is out of the way. (This matters for macOS 14, not 11).
Diffstat (limited to 'macosx/tkMacOSXWm.c')
-rw-r--r-- | macosx/tkMacOSXWm.c | 13 |
1 files changed, 11 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; } } } |