diff options
Diffstat (limited to 'generic/tkBind.c')
-rw-r--r-- | generic/tkBind.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c index 61b44df..285b3f7 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -1267,7 +1267,7 @@ Tk_BindEvent( */ if ((eventPtr->type >= TK_LASTEVENT) || !flagArray[eventPtr->type]) { - return; + return; } dispPtr = ((TkWindow *) tkwin)->dispPtr; @@ -2878,7 +2878,7 @@ GetAllVirtualEvents( * Any other fields in eventPtr which are not specified by the pattern * string or the optional arguments, are set to 0. * - * The event may be handled sychronously or asynchronously, depending on + * The event may be handled synchronously or asynchronously, depending on * the value specified by the optional "-when" option. The default * setting is synchronous. * @@ -3466,12 +3466,7 @@ HandleEventGenerate( if ((warp != 0) && Tk_IsMapped(tkwin)) { TkDisplay *dispPtr = TkGetDisplay(event.general.xmotion.display); - /* - * TODO: No protection is in place to handle dispPtr destruction - * before DoWarp is called back. - */ - - Tk_Window warpWindow = Tk_IdToWindow(dispPtr->display, +Tk_Window warpWindow = Tk_IdToWindow(dispPtr->display, event.general.xmotion.window); if (!(dispPtr->flags & TK_DISPLAY_IN_WARP)) { @@ -4321,6 +4316,33 @@ TkpGetBindingXEvent( } /* + *---------------------------------------------------------------------- + * + * TkpCancelWarp -- + * + * This function cancels an outstanding pointer warp and + * is called during tear down of the display. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +TkpCancelWarp( + TkDisplay *dispPtr) +{ + if (dispPtr->flags & TK_DISPLAY_IN_WARP) { + Tcl_CancelIdleCall(DoWarp, dispPtr); + dispPtr->flags &= ~TK_DISPLAY_IN_WARP; + } +} + +/* * Local Variables: * mode: c * c-basic-offset: 4 |