summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkGrab.c16
-rw-r--r--generic/tkPointer.c9
-rw-r--r--generic/tkWindow.c5
-rw-r--r--tests/event.test4
4 files changed, 6 insertions, 28 deletions
diff --git a/generic/tkGrab.c b/generic/tkGrab.c
index b4228bd..2c7c6ab 100644
--- a/generic/tkGrab.c
+++ b/generic/tkGrab.c
@@ -998,10 +998,6 @@ TkInOutEvents(
{
TkWindow *winPtr;
int upLevels, downLevels, i, j, focus;
-#define NAME(w) (w ? Tk_PathName(w) : "NULL")
-
- fprintf(stderr, "TkInOutEvents: %s -> %s\n",
- NAME(sourcePtr), NAME(destPtr));
/*
* There are four possible cases to deal with:
@@ -1047,24 +1043,19 @@ TkInOutEvents(
Tk_QueueWindowEvent(eventPtr, position); \
}
-#define DBGEV(w, t, d) fprintf(stderr, " Queueing %s %s for %s\n", t, d, NAME(w))
-
if (downLevels == 0) {
/*
* SourcePtr is an inferior of destPtr.
*/
if (leaveType != 0) {
- DBGEV(sourcePtr, "<Leave>", "NotifyAncestor");
QUEUE(sourcePtr, leaveType, NotifyAncestor);
for (winPtr = sourcePtr->parentPtr, i = upLevels-1; i > 0;
winPtr = winPtr->parentPtr, i--) {
- DBGEV(winPtr, "<Leave>", "NotifyVirtual");
QUEUE(winPtr, leaveType, NotifyVirtual);
}
}
if ((enterType != 0) && (destPtr != NULL)) {
- DBGEV(destPtr, "<Enter>", "NotifyVirtual");
QUEUE(destPtr, enterType, NotifyInferior);
}
} else if (upLevels == 0) {
@@ -1073,7 +1064,6 @@ TkInOutEvents(
*/
if ((leaveType != 0) && (sourcePtr != NULL)) {
- DBGEV(sourcePtr, "<Leave>", "NotifyInferior");
QUEUE(sourcePtr, leaveType, NotifyInferior);
}
if (enterType != 0) {
@@ -1082,11 +1072,9 @@ TkInOutEvents(
winPtr = winPtr->parentPtr, j++) {
/* empty */
}
- DBGEV(winPtr, "<Enter>", "NotifyVirtual");
QUEUE(winPtr, enterType, NotifyVirtual);
}
if (destPtr != NULL) {
- DBGEV(winPtr, "<Enter>", "NotifyVirtual");
QUEUE(destPtr, enterType, NotifyAncestor);
}
}
@@ -1096,11 +1084,9 @@ TkInOutEvents(
*/
if (leaveType != 0) {
- DBGEV(sourcePtr, "<Leave>", "NotifyNonlinear");
QUEUE(sourcePtr, leaveType, NotifyNonlinear);
for (winPtr = sourcePtr->parentPtr, i = upLevels-1; i > 0;
winPtr = winPtr->parentPtr, i--) {
- DBGEV(winPtr, "<Leave>", "NotifyNonlinearVirtual");
QUEUE(winPtr, leaveType, NotifyNonlinearVirtual);
}
}
@@ -1109,11 +1095,9 @@ TkInOutEvents(
for (winPtr = destPtr->parentPtr, j = 1; j < i;
winPtr = winPtr->parentPtr, j++) {
}
- DBGEV(winPtr, "<Enter>", "NotifyNonlinearVirtual");
QUEUE(winPtr, enterType, NotifyNonlinearVirtual);
}
if (destPtr != NULL) {
- DBGEV(destPtr, "<Enter>", "NotifyNonlinear");
QUEUE(destPtr, enterType, NotifyNonlinear);
}
}
diff --git a/generic/tkPointer.c b/generic/tkPointer.c
index df26de1..9f88d2f 100644
--- a/generic/tkPointer.c
+++ b/generic/tkPointer.c
@@ -228,10 +228,7 @@ Tk_UpdatePointer(
unsigned changes = (state ^ tsdPtr->lastState) & ALL_BUTTONS;
int type, b;
unsigned mask;
- fprintf(stderr, "TkUpdatePointer: %s -> %s\n",
- tsdPtr->lastWinPtr ? Tk_PathName(tsdPtr->lastWinPtr) : "NULL",
- tkwin ? Tk_PathName(tkwin) : "NULL");
- fflush(stderr);
+
pos.x = x;
pos.y = y;
@@ -496,11 +493,7 @@ TkPointerDeadWindow(
{
ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- fprintf(stderr, "TkPointerDeadWindow: %s\n", winPtr ? Tk_PathName(winPtr) : "NULL");
if (winPtr == tsdPtr->lastWinPtr) {
- //This fails on Windows because the windows version of TkWnDeadWindow
- //does not (yet) call TkUpdatePointer when a dead toplevel contains the
- //pointer.
tsdPtr->lastWinPtr = TkGetContainer(winPtr);
}
if (winPtr == tsdPtr->grabWinPtr) {
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index e8c56dd..e322bb4 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -1328,11 +1328,12 @@ static void SendEnterLeaveForDestroy(
{
#if defined(MAC_OSX_TK) || defined(_WIN32)
int x, y;
- unsigned int state = TkWinGetModifierState();
+ unsigned int state;
Tk_Window pointerWin;
TkWindow *containerPtr;
- TkGetPointerCoords(NULL, &x, &y);
+ XQueryPointer(Tk_Display(tkwin), None, NULL, NULL, &x, &y,
+ NULL, NULL, &state);
pointerWin = Tk_CoordsToWindow(x, y, tkwin);
if (pointerWin == tkwin) {
if (!Tk_IsTopLevel(tkwin)) {
diff --git a/tests/event.test b/tests/event.test
index f24c3c6..a099b5a 100644
--- a/tests/event.test
+++ b/tests/event.test
@@ -987,8 +987,8 @@ test event-9.13 {pointer window is a toplevel, toplevel destination} -setup {
wm withdraw .two
wm deiconify .two
waitForWindowEvent .two <Enter>
- bind all <Leave> {append result "<Leave> %d %W|" ; puts stderr "=leave=" }
- bind all <Enter> {append result "<Enter> %d %W|" ; puts stderr "-enter=" }
+ bind all <Leave> {append result "<Leave> %d %W|"}
+ bind all <Enter> {append result "<Enter> %d %W|"}
set result |
} -body {
destroy .two