summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorculler <culler>2021-10-29 19:01:24 (GMT)
committerculler <culler>2021-10-29 19:01:24 (GMT)
commit52e24a6d6ed3ff2cd17df86bb486d86195ada9fb (patch)
tree5cb7ca6c6daaf26d8e01b200aa218c8243d0584b /macosx
parent939f55bf59bd04c94a0c00330a67f26e8a840914 (diff)
downloadtk-52e24a6d6ed3ff2cd17df86bb486d86195ada9fb.zip
tk-52e24a6d6ed3ff2cd17df86bb486d86195ada9fb.tar.gz
tk-52e24a6d6ed3ff2cd17df86bb486d86195ada9fb.tar.bz2
Fix the fix so grab-6.1 still passes.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXMouseEvent.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index 03e71e1..95180e9 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -243,17 +243,20 @@ enum {
* coordinates of the target window. (The converted local coordinates are
* only needed for scrollwheel events.)
*
- * If a local grab is in effect and the target window is not
- * in the grabber's subtree then the event is discarded.
+ * If a local grab is in effect and the target window is not a child of the
+ * grab window, then the event is discarded.
*/
grabWinPtr = winPtr->dispPtr->grabWinPtr;
if (grabWinPtr && /* A grab is in effect */
!winPtr->dispPtr->grabFlags && /* and it is a local grab */
grabWinPtr->mainPtr == winPtr->mainPtr){ /* in the same application. */
- Tk_Window tkwin2;
-
- target = Tk_TopCoordsToWindow(grabWinPtr, local.x, local.y, &win_x, &win_y);
+ Tk_Window tkwin2, toplevel = tkwin;
+ if (Tk_IsTopLevel(grabWinPtr)) {
+ target = Tk_TopCoordsToWindow(grabWinPtr, global.x, global.y, &win_x, &win_y);
+ } else {
+ target = Tk_TopCoordsToWindow(tkwin, local.x, local.y, &win_x, &win_y);
+ }
if (!target) {
return theEvent;
}