Subject: Fixed crash when calling event generate {} <Motion> -warp 1

From: fvogel <[email-masked]>
Date: Mon, 30 May 2016 19:38:04 +0000

---
 generic/tkBind.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/generic/tkBind.c b/generic/tkBind.c
index 4374494..3b05066 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -3539,10 +3539,13 @@ DoWarp(
      * 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.
+     * Finally, the case warpWindow == NULL is special in that it means
+     * the whole screen.
      */
 
-    if (Tk_IsMapped(dispPtr->warpWindow)
-            && (Tk_WindowId(dispPtr->warpWindow) != None)) {
+    if ((dispPtr->warpWindow == NULL) ||
+            (Tk_IsMapped(dispPtr->warpWindow)
+            && (Tk_WindowId(dispPtr->warpWindow) != None))) {
         TkpWarpPointer(dispPtr);
         XForceScreenSaver(dispPtr->display, ScreenSaverReset);
     }
-- 
cgit v0.12