summaryrefslogtreecommitdiffstats
path: root/tests/event.test
diff options
context:
space:
mode:
authormdejong <mdejong>2003-02-18 06:22:44 (GMT)
committermdejong <mdejong>2003-02-18 06:22:44 (GMT)
commit1821e19bc72152b13ef6a7789b22bf239d713846 (patch)
tree4c81cd56ef843501912d782732a5165b523d2f02 /tests/event.test
parenta90f19807e0282b4c15f10bd77b96d1c281b22d3 (diff)
downloadtk-1821e19bc72152b13ef6a7789b22bf239d713846.zip
tk-1821e19bc72152b13ef6a7789b22bf239d713846.tar.gz
tk-1821e19bc72152b13ef6a7789b22bf239d713846.tar.bz2
* generic/tkEvent.c (Tk_HandleEvent): Fixup button
press state saving code, it was incorrectly converting normal motion events into button press and motion events in some cases. * generic/tkInt.h: Add mouseButtonWindow member to the TkDisplay structure. * tests/event.test: Add test case for faulty button motion logic.
Diffstat (limited to 'tests/event.test')
-rw-r--r--tests/event.test17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/event.test b/tests/event.test
index e989f02..66fc029 100644
--- a/tests/event.test
+++ b/tests/event.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: event.test,v 1.12 2002/12/02 03:42:28 mdejong Exp $
+# RCS: @(#) $Id: event.test,v 1.13 2003/02/18 06:22:44 mdejong Exp $
package require tcltest 2.1
namespace import -force tcltest::configure
@@ -649,6 +649,21 @@ test event-triple-click-drag-1.1 { Triple click and drag across lines in
} [list "LINE THREE\n" "LINE TWO\nLINE THREE\n" \
"LINE ONE\nLINE TWO\nLINE THREE\n"]
+test event-button-state-1.1 { button press in a window that is then
+ destroyed, when the mouse is moved into another window it
+ should not generate a <B1-motion> event since the mouse
+ was not pressed down in that window. } {
+ destroy .t
+ set t [toplevel .t]
+
+ event generate $t <ButtonPress-1>
+ destroy $t
+ set t [toplevel .t]
+ set motion nomotion
+ bind $t <B1-Motion> {set motion inmotion}
+ event generate $t <Motion>
+ set motion
+} nomotion
# cleanup