summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogel@noemail.net>2016-05-30 20:28:46 (GMT)
committerfvogel <fvogel@noemail.net>2016-05-30 20:28:46 (GMT)
commit16962f7e1a1fa00d49a77d2f26bda834bd42e49a (patch)
tree61eeb47d6a39314452eed642f297dd8fdd10fa58
parent938999556890c0e4870fc3d43671486c960d0bd7 (diff)
parent3c123513d743d8349794fa2ba9b8a283a69b4601 (diff)
downloadtk-16962f7e1a1fa00d49a77d2f26bda834bd42e49a.zip
tk-16962f7e1a1fa00d49a77d2f26bda834bd42e49a.tar.gz
tk-16962f7e1a1fa00d49a77d2f26bda834bd42e49a.tar.bz2
Fixed tests cases bad interactions and a forgotten mouse warping case (event generate {} <...> -warp 1 is valid)
FossilOrigin-Name: 32b7a0621bdc134b85d7332e02d31563c2515714
-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 {