diff options
author | culler <culler> | 2018-12-17 14:38:39 (GMT) |
---|---|---|
committer | culler <culler> | 2018-12-17 14:38:39 (GMT) |
commit | 394280cc3f6bb4b807560ad4bd02688dc2c43d48 (patch) | |
tree | cc8d3ca8ebccdb55b2b9f84c9fe0bf582cb75690 /macosx/tkMacOSXWm.c | |
parent | 8ba154154bdb9c4923685db7baff72c1c7a085c5 (diff) | |
download | tk-394280cc3f6bb4b807560ad4bd02688dc2c43d48.zip tk-394280cc3f6bb4b807560ad4bd02688dc2c43d48.tar.gz tk-394280cc3f6bb4b807560ad4bd02688dc2c43d48.tar.bz2 |
Make the Mac also return NULL for points in the title bar.
Diffstat (limited to 'macosx/tkMacOSXWm.c')
-rw-r--r-- | macosx/tkMacOSXWm.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 2764fee..0eafbda 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -594,8 +594,8 @@ SetWindowSizeLimits( * * FrontWindowAtPoint -- * - * Find frontmost toplevel window at a given screen location - * which has the specified mainPtr. + * Find frontmost toplevel window at a given screen location which has the + * specified mainPtr. If the location is in the title bar, return NULL. * * Results: * TkWindow*. @@ -619,19 +619,22 @@ FrontWindowAtPoint( winPtr = TkMacOSXGetTkWindow(w); if (winPtr) { WmInfo *wmPtr = winPtr->wmInfoPtr; - NSRect frame = [w frame]; - + NSRect windowFrame = [w frame]; + 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. */ - frame.size.height = [[w contentView] frame].size.height; - if (NSMouseInRect(p, frame, NO) && - (wmPtr->hints.initial_state == NormalState || + if ((wmPtr->hints.initial_state == NormalState || wmPtr->hints.initial_state == ZoomState)) { - return winPtr; + if (NSMouseInRect(p, contentFrame, NO)) { + return winPtr; + } else if (NSMouseInRect(p, windowFrame, NO)) { + return NULL; + } } } } |