From 169bf5a922972c64aa154479d588919763f77e88 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 2 Jun 2020 06:52:47 +0000 Subject: Remove the TK_DISPLAY_IN_WARP machinery completely. --- generic/tkBind.c | 38 +++----------------------------------- generic/tkGrab.c | 16 ++++++---------- generic/tkInt.h | 6 +----- generic/tkWindow.c | 2 -- 4 files changed, 10 insertions(+), 52 deletions(-) diff --git a/generic/tkBind.c b/generic/tkBind.c index a2f8532..7fd9e74 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -4375,12 +4375,9 @@ HandleEventGenerate( * making this case sleep with grabs). */ - if (!(dispPtr->flags & TK_DISPLAY_IN_WARP)) { - dispPtr->flags |= TK_DISPLAY_IN_WARP; - if (!dispPtr->warpWindow) { - DoWarp(dispPtr); - } - } + if (!dispPtr->warpWindow) { + DoWarp(dispPtr); + } } /* @@ -4492,7 +4489,6 @@ DoWarp( TkpWarpPointer(dispPtr); XForceScreenSaver(dispPtr->display, ScreenSaverReset); - dispPtr->flags &= ~TK_DISPLAY_IN_WARP; } /* @@ -5263,34 +5259,6 @@ 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) -{ - assert(dispPtr); - - if (dispPtr->flags & TK_DISPLAY_IN_WARP) { - dispPtr->flags &= ~TK_DISPLAY_IN_WARP; - } -} - -/* - *---------------------------------------------------------------------- - * * TkpDumpPS -- * * Dump given pattern sequence to stdout. diff --git a/generic/tkGrab.c b/generic/tkGrab.c index 0750bd5..c923608 100644 --- a/generic/tkGrab.c +++ b/generic/tkGrab.c @@ -775,14 +775,13 @@ TkPointerEvent( } if ((eventPtr->type == MotionNotify) && !appGrabbed) { - if ((dispPtr->flags & TK_DISPLAY_IN_WARP)) { - /* - * A NULL warpWindow means warping with respect to the whole screen. - * We can only be here if we're warping with respect to a window. - */ + /* + * A NULL warpWindow means warping with respect to the whole screen. + * We want to warp here only if we're warping with respect to a window. + */ - assert(dispPtr->warpWindow); + if (dispPtr->warpWindow) { /* * Warping with respect to a window can only be done if the window is @@ -797,7 +796,6 @@ TkPointerEvent( } Tcl_Release(dispPtr->warpWindow); dispPtr->warpWindow = NULL; - dispPtr->flags &= ~TK_DISPLAY_IN_WARP; } } @@ -827,15 +825,13 @@ TkPointerEvent( Tk_QueueWindowEvent(eventPtr, TCL_QUEUE_HEAD); return 0; } - if ((dispPtr->flags & TK_DISPLAY_IN_WARP)) { - assert(dispPtr->warpWindow); + if (dispPtr->warpWindow) { if (Tk_IsMapped(dispPtr->warpWindow) && Tk_WindowId(dispPtr->warpWindow) != None) { TkpWarpPointer(dispPtr); XForceScreenSaver(dispPtr->display, ScreenSaverReset); } Tcl_Release(dispPtr->warpWindow); dispPtr->warpWindow = NULL; - dispPtr->flags &= ~TK_DISPLAY_IN_WARP; } return 1; } diff --git a/generic/tkInt.h b/generic/tkInt.h index c1bd562d..cc710d6 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -535,15 +535,12 @@ typedef struct TkDisplay { * Whether to use input methods for this display * TK_DISPLAY_WM_TRACING: (default off) * Whether we should do wm tracing on this display. - * TK_DISPLAY_IN_WARP: (default off) - * Indicates that we are in a pointer warp */ #define TK_DISPLAY_COLLAPSE_MOTION_EVENTS (1 << 0) #define TK_DISPLAY_USE_IM (1 << 1) #define TK_DISPLAY_WM_TRACING (1 << 3) -#define TK_DISPLAY_IN_WARP (1 << 4) -#define TK_DISPLAY_USE_XKB (1 << 5) +#define TK_DISPLAY_USE_XKB (1 << 4) /* * One of the following structures exists for each error handler created by a @@ -1251,7 +1248,6 @@ MODULE_SCOPE int TkInitTkCmd(Tcl_Interp *interp, MODULE_SCOPE int TkInitFontchooser(Tcl_Interp *interp, ClientData clientData); MODULE_SCOPE void TkpWarpPointer(TkDisplay *dispPtr); -MODULE_SCOPE void TkpCancelWarp(TkDisplay *dispPtr); MODULE_SCOPE int TkListCreateFrame(ClientData clientData, Tcl_Interp *interp, Tcl_Obj *listObj, int toplevel, Tcl_Obj *nameObj); diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 00fb344..93282dc 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -239,8 +239,6 @@ TkCloseDisplay( { TkClipCleanup(dispPtr); - TkpCancelWarp(dispPtr); - if (dispPtr->name != NULL) { ckfree(dispPtr->name); } -- cgit v0.12