summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-05-26 18:21:34 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-05-26 18:21:34 (GMT)
commitbfc87e3ce9f57f6f966f6cf423d1064487cb887b (patch)
treee283869e669211ec1acc4dbb9689fdf0883dc8fa
parent6ceb9aa8c5ae688f8f59178fb7b1139ce657b1ae (diff)
downloadtk-bfc87e3ce9f57f6f966f6cf423d1064487cb887b.zip
tk-bfc87e3ce9f57f6f966f6cf423d1064487cb887b.tar.gz
tk-bfc87e3ce9f57f6f966f6cf423d1064487cb887b.tar.bz2
Fixed [79549a9134] - Mouse pointer warping crashes
-rw-r--r--generic/tkBind.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c
index 9cd3b7b..81c768b 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -3535,8 +3535,16 @@ 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. In
+ * particular, this guards against window destruction in the meantime.
+ */
+
+ if (Tk_IsMapped(dispPtr->warpWindow)) {
+ TkpWarpPointer(dispPtr);
+ XForceScreenSaver(dispPtr->display, ScreenSaverReset);
+ }
dispPtr->flags &= ~TK_DISPLAY_IN_WARP;
}