summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorculler <culler>2018-12-12 04:18:26 (GMT)
committerculler <culler>2018-12-12 04:18:26 (GMT)
commit49d7bce77f6087d0abe19715ce2c5d39359e2313 (patch)
tree0b0dcba515ad0f342d49c54a994794a6fae34be6 /unix
parent76d4fe8f69c4551713f36190c1ae1d785b0b1e38 (diff)
downloadtk-49d7bce77f6087d0abe19715ce2c5d39359e2313.zip
tk-49d7bce77f6087d0abe19715ce2c5d39359e2313.tar.gz
tk-49d7bce77f6087d0abe19715ce2c5d39359e2313.tar.bz2
Correct some of the logic in Tk_CoordsToWindow.
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixWm.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index 399916f..e8d420a 100644
--- a/unix/tkUnixWm.c
+++ b/unix/tkUnixWm.c
@@ -5856,14 +5856,27 @@ Tk_CoordsToWindow(
for (wmPtr = (WmInfo *) dispPtr->firstWmPtr; wmPtr != NULL;
wmPtr = wmPtr->nextPtr) {
winPtr = wmPtr->winPtr;
- if (wmPtr->winPtr == NULL) {
+ if (winPtr == NULL) {
+
+ /*
+ * This happens, for example, if the wmPtr points to a Gnome3
+ * "invisible border". Ignore this window and keep searching.
+ */
+
continue;
}
- if (x >= winPtr->changes.x &&
- x < winPtr->changes.x + winPtr->changes.width &&
- y < winPtr->changes.y + winPtr->changes.height) {
- goto gotToplevel;
+ if (x < winPtr->changes.x ||
+ x > winPtr->changes.x + winPtr->changes.width ||
+ y < winPtr->changes.y ||
+ y > winPtr->changes.y + winPtr->changes.height) {
+
+ /*
+ * The point is completely outside the window; keep searching.
+ */
+
+ continue;
}
+ goto gotToplevel;
}
x = childX;
y = childY;
@@ -5871,7 +5884,7 @@ Tk_CoordsToWindow(
window = child;
}
- gotToplevel:
+ gotToplevel:
if (handler) {
/*
* Check value of handler, because we can reach this label from above
@@ -5895,6 +5908,7 @@ Tk_CoordsToWindow(
x = childX - winPtr->changes.x;
y = childY - winPtr->changes.y;
+
if (y < 0) {
winPtr = (TkWindow *) wmPtr->menubar;
if (winPtr == NULL) {