diff options
author | culler <culler> | 2024-05-21 22:42:45 (GMT) |
---|---|---|
committer | culler <culler> | 2024-05-21 22:42:45 (GMT) |
commit | e4fbaea258605ad01892f783375433c8bf613270 (patch) | |
tree | ce2efe4e25238f174512028133dd90b6a203bb65 /win/tkWinWm.c | |
parent | 080aeeed22a914bdf8f1de650e6a4f2c34824104 (diff) | |
download | tk-e4fbaea258605ad01892f783375433c8bf613270.zip tk-e4fbaea258605ad01892f783375433c8bf613270.tar.gz tk-e4fbaea258605ad01892f783375433c8bf613270.tar.bz2 |
Only 9.13, 9.14. and 9.19 fail on windows. Debug output included.
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r-- | win/tkWinWm.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 90503a6..146b82b 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -2577,6 +2577,36 @@ TkpWmGetState( *-------------------------------------------------------------- */ +static void CheckForPointer(TkWindow *winPtr) +{ + Display *display = Tk_Display(winPtr); + POINT mouse; + unsigned int state = TkWinGetModifierState(); + TkWindow **windows = TkWmStackorderToplevel(winPtr->mainPtr->winPtr); + TkWindow **w; + TkGetPointerCoords(NULL, &mouse.x, &mouse.y); + fprintf(stderr, "CheckForPointer: %s with mouse @(%d, %d)\n", + Tk_PathName(winPtr), mouse.x, mouse.y); + if (windows != NULL) { + for (w = windows; *w ; w++) { + RECT windowRect; + HWND hwnd = Tk_GetHWND(Tk_WindowId((Tk_Window) *w)); + fprintf(stderr, " Checking %s\n", Tk_PathName(*w)); + if (GetWindowRect(hwnd, &windowRect) == 0) { + continue; + } + if (winPtr != *w && PtInRect(&windowRect, mouse)) { + fprintf(stderr, "Pointer is in %s. Calling Tk_UpdatePointer\n", + Tk_PathName(*w)); + Tk_UpdatePointer((Tk_Window) *w, mouse.x, mouse.y, state); + break; + } + } + ckfree(windows); + } + fflush(stderr); +} + void TkWmDeadWindow( TkWindow *winPtr) /* Top-level window that's being deleted. */ @@ -2715,6 +2745,15 @@ TkWmDeadWindow( DecrIconRefCount(wmPtr->iconPtr); } + /* + * Check if the dead window is a toplevel containing the pointer. If so, + * find the window which will inherit the pointer and call + * TkUpdatePointer. + */ + + CheckForPointer(winPtr); + //TkPointerDeadWindow(winPtr); + ckfree(wmPtr); winPtr->wmInfoPtr = NULL; } |