summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixWm.c
diff options
context:
space:
mode:
authorculler <culler>2018-12-16 21:54:22 (GMT)
committerculler <culler>2018-12-16 21:54:22 (GMT)
commitb587cc3fcafb8c360bd85b80d638a0d1f7a6ebde (patch)
treedf3a71d3daf84e25cb0805929b879bfba481d36f /unix/tkUnixWm.c
parent55943785efe5639b3ada935ce718ad6fd0bed6b2 (diff)
downloadtk-b587cc3fcafb8c360bd85b80d638a0d1f7a6ebde.zip
tk-b587cc3fcafb8c360bd85b80d638a0d1f7a6ebde.tar.gz
tk-b587cc3fcafb8c360bd85b80d638a0d1f7a6ebde.tar.bz2
Make unixWm-50.3 use a slave rather than dobg and fix the bug it revealed.
Diffstat (limited to 'unix/tkUnixWm.c')
-rw-r--r--unix/tkUnixWm.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index 96a10c4..5bee6ba 100644
--- a/unix/tkUnixWm.c
+++ b/unix/tkUnixWm.c
@@ -5812,7 +5812,7 @@ Tk_CoordsToWindow(
TkWindow *winPtr, *childPtr, *nextPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
Tk_ErrorHandler handler = NULL;
-
+
/*
* Step 1: scan the list of toplevel windows to see if there is a virtual
* root for the screen we're interested in. If so, we have to translate
@@ -5915,7 +5915,14 @@ Tk_CoordsToWindow(
if (wmPtr->wrapperPtr != NULL) {
if (child == wmPtr->wrapperPtr->window) {
goto gotToplevel;
- }
+ } else if (wmPtr->winPtr->flags & TK_EMBEDDED &&
+ TkpGetOtherWindow(wmPtr->winPtr) == NULL) {
+ int rx, ry;
+ Tk_GetRootCoords((Tk_Window) wmPtr->winPtr, &rx, &ry);
+ childX -= rx;
+ childY -= ry;
+ goto gotToplevel;
+ }
} else if (child == wmPtr->winPtr->window) {
goto gotToplevel;
}
@@ -5937,9 +5944,6 @@ Tk_CoordsToWindow(
handler = NULL;
}
winPtr = wmPtr->winPtr;
- if (winPtr->mainPtr != ((TkWindow *) tkwin)->mainPtr) {
- return NULL;
- }
/*
* Step 3: at this point winPtr and wmPtr refer to the toplevel that
@@ -5996,27 +6000,30 @@ Tk_CoordsToWindow(
if (nextPtr == NULL) {
break;
}
- winPtr = nextPtr;
- x -= winPtr->changes.x;
- y -= winPtr->changes.y;
- if ((winPtr->flags & TK_CONTAINER)
- && (winPtr->flags & TK_BOTH_HALVES)) {
+ x -= nextPtr->changes.x;
+ y -= nextPtr->changes.y;
+ if ((nextPtr->flags & TK_CONTAINER)
+ && (nextPtr->flags & TK_BOTH_HALVES)) {
/*
* The window containing the point is a container, and the
* embedded application is in this same process. Switch over to
* the toplevel for the embedded application and start processing
* that toplevel from scratch.
*/
-
- winPtr = TkpGetOtherWindow(winPtr);
+ winPtr = TkpGetOtherWindow(nextPtr);
if (winPtr == NULL) {
- return NULL;
+ return (Tk_Window) nextPtr;
}
wmPtr = winPtr->wmInfoPtr;
childX = x;
childY = y;
goto gotToplevel;
- }
+ } else {
+ winPtr = nextPtr;
+ }
+ }
+ if (winPtr->mainPtr != ((TkWindow *) tkwin)->mainPtr) {
+ return NULL;
}
return (Tk_Window) winPtr;
}