diff options
author | culler <culler> | 2024-06-10 15:37:44 (GMT) |
---|---|---|
committer | culler <culler> | 2024-06-10 15:37:44 (GMT) |
commit | 338762b617f55c9699753c8f38f582bf70b23dee (patch) | |
tree | 8d05b190e6d88eb530660fc96c5c59d3ffa2597e /win | |
parent | 06a4ba5407ebd451d8ab5d56bb06fad34f24766f (diff) | |
parent | 3f0a126393198d3f6e0dff58e479ee9cab5b213d (diff) | |
download | tk-338762b617f55c9699753c8f38f582bf70b23dee.zip tk-338762b617f55c9699753c8f38f582bf70b23dee.tar.gz tk-338762b617f55c9699753c8f38f582bf70b23dee.tar.bz2 |
New branch: merges the crossing events fix (sans processevents) with cgimage drawing
Diffstat (limited to 'win')
-rw-r--r-- | win/tkWinWm.c | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c index f6d3216..4ad0056 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -2466,6 +2466,33 @@ TkpWmGetState( *-------------------------------------------------------------- */ +static void CheckForPointer(TkWindow *winPtr) +{ + POINT mouse; + int x, y; + unsigned int state = TkWinGetModifierState(); + TkWindow **windows = TkWmStackorderToplevel(winPtr->mainPtr->winPtr); + TkWindow **w; + TkGetPointerCoords(NULL, &x, &y); + mouse.x = x; + mouse.y = y; + if (windows != NULL) { + for (w = windows; *w ; w++) { + RECT windowRect; + HWND hwnd = Tk_GetHWND(Tk_WindowId((Tk_Window) *w)); + if (GetWindowRect(hwnd, &windowRect) == 0) { + continue; + } + if (winPtr != *w && PtInRect(&windowRect, mouse)) { + Tk_Window target = Tk_CoordsToWindow(x, y, (Tk_Window) *w); + Tk_UpdatePointer((Tk_Window) target, x, y, state); + break; + } + } + ckfree(windows); + } +} + void TkWmDeadWindow( TkWindow *winPtr) /* Top-level window that's being deleted. */ @@ -2604,6 +2631,13 @@ 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); ckfree(wmPtr); winPtr->wmInfoPtr = NULL; } @@ -6595,8 +6629,6 @@ TkWmStackorderToplevelEnumProc( TkWmStackorderToplevelPair *pair = (TkWmStackorderToplevelPair *) lParam; - /*fprintf(stderr, "Looking up HWND %d\n", hwnd);*/ - hPtr = Tcl_FindHashEntry(pair->table, hwnd); if (hPtr != NULL) { childWinPtr = (TkWindow *)Tcl_GetHashValue(hPtr); |