diff options
author | fvogel <fvogelnew1@free.fr> | 2020-06-02 20:48:00 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2020-06-02 20:48:00 (GMT) |
commit | f0b89aefda27ec85cef23db0ada5b6e292844a1b (patch) | |
tree | 14fabfb1455d9e289f26c832489cebd9d9ebca90 /generic/tkGrab.c | |
parent | 169bf5a922972c64aa154479d588919763f77e88 (diff) | |
download | tk-f0b89aefda27ec85cef23db0ada5b6e292844a1b.zip tk-f0b89aefda27ec85cef23db0ada5b6e292844a1b.tar.gz tk-f0b89aefda27ec85cef23db0ada5b6e292844a1b.tar.bz2 |
Rename DoWarp to DoWarWrtScreen, add function DoWarpWrtWin to factorize the code a bit.
Diffstat (limited to 'generic/tkGrab.c')
-rw-r--r-- | generic/tkGrab.c | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/generic/tkGrab.c b/generic/tkGrab.c index c923608..711bcad 100644 --- a/generic/tkGrab.c +++ b/generic/tkGrab.c @@ -775,28 +775,7 @@ TkPointerEvent( } if ((eventPtr->type == MotionNotify) && !appGrabbed) { - - /* - * 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. - */ - - if (dispPtr->warpWindow) { - - /* - * Warping with respect to a window can only be done if the window is - * mapped. This was checked in HandleEvent. The windows needs to be - * still mapped at the time the present code is executed. Also - * one needs to guard against window destruction in the meantime. - */ - - if (Tk_IsMapped(dispPtr->warpWindow) && Tk_WindowId(dispPtr->warpWindow) != None) { - TkpWarpPointer(dispPtr); - XForceScreenSaver(dispPtr->display, ScreenSaverReset); - } - Tcl_Release(dispPtr->warpWindow); - dispPtr->warpWindow = NULL; - } + DoWarpWrtWin(dispPtr); } if (!appGrabbed) { @@ -825,14 +804,7 @@ TkPointerEvent( Tk_QueueWindowEvent(eventPtr, TCL_QUEUE_HEAD); return 0; } - 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; - } + DoWarpWrtWin(dispPtr); return 1; } |