diff options
author | fvogel <fvogelnew1@free.fr> | 2020-06-02 06:45:54 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2020-06-02 06:45:54 (GMT) |
commit | 7e224c0bcdec400cbdb89459313b1e4ea73bc896 (patch) | |
tree | f211251c32b74e5c98846a6833a11d92c7e2b6ba /generic | |
parent | 6694505c3ede36fbdf40007bf50495675a8d9455 (diff) | |
download | tk-7e224c0bcdec400cbdb89459313b1e4ea73bc896.zip tk-7e224c0bcdec400cbdb89459313b1e4ea73bc896.tar.gz tk-7e224c0bcdec400cbdb89459313b1e4ea73bc896.tar.bz2 |
Warping with respect to the whole screen is now synchronous as well (it is no longer executed as an idle task). This allows to remove some further update/after commands in tests.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkBind.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c index ea1f721..a2f8532 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -717,7 +717,7 @@ static int NameToWindow(Tcl_Interp *interp, Tk_Window main, Tcl_Obj *objPtr, Tk_Window *tkwinPtr); static unsigned ParseEventDescription(Tcl_Interp *interp, const char **eventStringPtr, TkPattern *patPtr, EventMask *eventMaskPtr); -static void DoWarp(ClientData clientData); +static void DoWarp(TkDisplay *dispPtr); static PSList * GetLookupForEvent(LookupTables* lookupPtr, const Event *eventPtr, Tcl_Obj *object, int onlyConsiderDetailedEvents); static void ClearLookupTable(LookupTables *lookupTables, ClientData object); @@ -4376,10 +4376,10 @@ HandleEventGenerate( */ if (!(dispPtr->flags & TK_DISPLAY_IN_WARP)) { + dispPtr->flags |= TK_DISPLAY_IN_WARP; if (!dispPtr->warpWindow) { - Tcl_DoWhenIdle(DoWarp, dispPtr); + DoWarp(dispPtr); } - dispPtr->flags |= TK_DISPLAY_IN_WARP; } } @@ -4466,24 +4466,22 @@ NameToWindow( * * DoWarp -- * - * Perform Warping of X pointer. Executed as an idle handler only. + * Perform warping of mouse pointer with respect to the whole screen. * * Results: * None * * Side effects: - * X Pointer will move to a new location. + * Mouse pointer moves to a new location. * *------------------------------------------------------------------------- */ static void DoWarp( - ClientData clientData) + TkDisplay *dispPtr) { - TkDisplay *dispPtr = clientData; - - assert(clientData); + assert(dispPtr); /* * A non-NULL warpWindow means warping with respect to this window. @@ -5286,7 +5284,6 @@ TkpCancelWarp( assert(dispPtr); if (dispPtr->flags & TK_DISPLAY_IN_WARP) { - Tcl_CancelIdleCall(DoWarp, dispPtr); dispPtr->flags &= ~TK_DISPLAY_IN_WARP; } } |