From c255ed1528a9642c56f55b48730ba80f628edfb5 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 30 May 2016 19:38:04 +0000 Subject: Fixed crash when calling event generate {} -warp 1 FossilOrigin-Name: 0d6f2de7da61e5b0f0dd2951f34920e69098995f --- 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 From 62dce6be73f49e32d47749e712d4b110708dbd00 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 30 May 2016 20:16:28 +0000 Subject: A mouse button once pressed should be released. Doing otherwise messes up with assumptions in other (later) tests from the test suite, which reasonably think they start with all mouse buttons depressed. In the present case, canvas-13.1 failed because event generation of was missing in test bind-32 FossilOrigin-Name: 3b56aa53f67e1d6a830d413236bfcaab8b16c7b4 --- tests/bind.test | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/bind.test b/tests/bind.test index 387b119..c26cfcd 100644 --- a/tests/bind.test +++ b/tests/bind.test @@ -6100,6 +6100,7 @@ test bind-32 {-warp, window was destroyed before the idle callback DoWarp} -setu update } -body { event generate .t.f -warp 1 + event generate .t.f destroy .t.f update ; # shall simply not crash } -cleanup { -- cgit v0.12