summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-05-30 18:33:40 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-05-30 18:33:40 (GMT)
commitf363246b699fde869681e5213bc1e6e100e81529 (patch)
tree0feec6a06cde63ca3b4b0bd6129f1824451219db /generic
parent88516c26fd029f03f6ace99463da1ece2844399f (diff)
parentef21094dd7164fbf1d96d8c33570f4803b7e35e6 (diff)
downloadtk-f363246b699fde869681e5213bc1e6e100e81529.zip
tk-f363246b699fde869681e5213bc1e6e100e81529.tar.gz
tk-f363246b699fde869681e5213bc1e6e100e81529.tar.bz2
Fixed [79549a9134] - Mouse pointer warping crashes
Diffstat (limited to 'generic')
-rw-r--r--generic/tkBind.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c
index 9cd3b7b..4374494 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -3535,8 +3535,17 @@ DoWarp(
{
TkDisplay *dispPtr = clientData;
- TkpWarpPointer(dispPtr);
- XForceScreenSaver(dispPtr->display, ScreenSaverReset);
+ /*
+ * DoWarp was scheduled only if the window was mapped. It needs to be
+ * still mapped at the time the present idle callback 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);
+ }
dispPtr->flags &= ~TK_DISPLAY_IN_WARP;
}