summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkBind.c7
-rw-r--r--tests/bind.test1
2 files changed, 6 insertions, 2 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c
index 8ee5994..acc4e43 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);
}
diff --git a/tests/bind.test b/tests/bind.test
index 9f0caa7..374ef9b 100644
--- a/tests/bind.test
+++ b/tests/bind.test
@@ -6164,6 +6164,7 @@ test bind-32 {-warp, window was destroyed before the idle callback DoWarp} -setu
update
} -body {
event generate .t.f <Button-1> -warp 1
+ event generate .t.f <ButtonRelease-1>
destroy .t.f
update ; # shall simply not crash
} -cleanup {