summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-05-30 18:36:48 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-05-30 18:36:48 (GMT)
commit04fec7a1258813e4b388f6ed6e6111f1374065cb (patch)
treec03f283d8eb1c4cf5ca30ce5f4859c92849c691b /generic
parentf7271371b3ef0ae8c36fa3cfff4dd0409d2437dc (diff)
parentf363246b699fde869681e5213bc1e6e100e81529 (diff)
downloadtk-04fec7a1258813e4b388f6ed6e6111f1374065cb.zip
tk-04fec7a1258813e4b388f6ed6e6111f1374065cb.tar.gz
tk-04fec7a1258813e4b388f6ed6e6111f1374065cb.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 c75f6a0..8ee5994 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;
}