summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorculler <culler>2018-12-14 19:44:43 (GMT)
committerculler <culler>2018-12-14 19:44:43 (GMT)
commit55943785efe5639b3ada935ce718ad6fd0bed6b2 (patch)
tree7899bea04f25dc385024d07465b517c6c4a658fa
parent7a359d16f322e88b8af5b7208eb63e53a5f3ec91 (diff)
downloadtk-55943785efe5639b3ada935ce718ad6fd0bed6b2.zip
tk-55943785efe5639b3ada935ce718ad6fd0bed6b2.tar.gz
tk-55943785efe5639b3ada935ce718ad6fd0bed6b2.tar.bz2
On second thought, it is better to follow X11 and return an empty string when the top
window containing the point has a different interpreter.
-rw-r--r--macosx/tkMacOSXWm.c10
-rw-r--r--tests/unixWm.test10
2 files changed, 5 insertions, 15 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 0b39f1a..2091de0 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -609,8 +609,7 @@ SetWindowSizeLimits(
static TkWindow*
FrontWindowAtPoint(
int x,
- int y,
- TkMainInfo *mainPtr)
+ int y)
{
NSPoint p = NSMakePoint(x, tkMacOSXZeroScreenHeight - y);
NSArray *windows = [NSApp orderedWindows];
@@ -618,7 +617,7 @@ FrontWindowAtPoint(
for (NSWindow *w in windows) {
winPtr = TkMacOSXGetTkWindow(w);
- if (winPtr && winPtr->mainPtr == mainPtr) {
+ if (winPtr) {
WmInfo *wmPtr = winPtr->wmInfoPtr;
NSRect frame = [w frame];
@@ -4401,7 +4400,6 @@ Tk_CoordsToWindow(
TkWindow *winPtr, *childPtr;
TkWindow *nextPtr; /* Coordinates of highest child found so far
* that contains point. */
- TkMainInfo *mainPtr = ((TkWindow *) tkwin)->mainPtr;
int x, y; /* Coordinates in winPtr. */
int tmpx, tmpy, bd;
@@ -4409,8 +4407,8 @@ Tk_CoordsToWindow(
* Step 1: find the top-level window that contains the desired point.
*/
- winPtr = FrontWindowAtPoint(rootX, rootY, mainPtr);
- if (!winPtr) {
+ winPtr = FrontWindowAtPoint(rootX, rootY);
+ if (!winPtr || winPtr->mainPtr != ((TkWindow *) tkwin)->mainPtr) {
return NULL;
}
diff --git a/tests/unixWm.test b/tests/unixWm.test
index d77fcd5..443254c 100644
--- a/tests/unixWm.test
+++ b/tests/unixWm.test
@@ -1855,14 +1855,6 @@ test unixWm-50.3 {
} -cleanup {
cleanupbg
} -result {{} .x .t .t.f}
-# On X11 winfo containing returns an empty string if the top window
-# containing the point belongs to a different interpreter. Not so
-# on aqua.
-if {[tk windowingsystem] == "aqua"} {
- set result_50_4 [list ".t" "."]
- } else {
- set result_50_4 [list "" "."]
-}
test unixWm-50.4 {Tk_CoordsToWindow procedure, window in other application} unix {
destroy .t
@@ -1877,7 +1869,7 @@ test unixWm-50.4 {Tk_CoordsToWindow procedure, window in other application} unix
[slave eval {winfo containing 100 100}]]
interp delete slave
set result
-} $result_50_4
+} {{} .}
test unixWm-50.5 {Tk_CoordsToWindow procedure, handling menubars} {unix testmenubar} {
deleteWindows
toplevel .t -width 300 -height 400 -bd 2 -relief raised