summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2011-04-30 22:29:49 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2011-04-30 22:29:49 (GMT)
commit8bd5cf46f53712c5c4ee5dd8f1cfbbf761075bb0 (patch)
tree16dd6070902ecdc868ec7e34f5efa9756bcc04f0 /library
parent4f503e1d1c1ba2e564bf26b58a23c3caf2c411ea (diff)
downloadtk-8bd5cf46f53712c5c4ee5dd8f1cfbbf761075bb0.zip
tk-8bd5cf46f53712c5c4ee5dd8f1cfbbf761075bb0.tar.gz
tk-8bd5cf46f53712c5c4ee5dd8f1cfbbf761075bb0.tar.bz2
[Bug 3294593] fix menu unposting under some conditions.
Moving the pointer off a cascaded submenu over the application window and then back to the parent menu window on a non-cascade entry would leave the submenu displayed when it should be unposted. This patch solves this issue. Suggested-by: Schelte Bron <sbron@users.sourceforge.net> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Diffstat (limited to 'library')
-rw-r--r--library/menu.tcl9
1 files changed, 4 insertions, 5 deletions
diff --git a/library/menu.tcl b/library/menu.tcl
index e415ce0..31da4fb 100644
--- a/library/menu.tcl
+++ b/library/menu.tcl
@@ -567,15 +567,14 @@ proc ::tk::MenuMotion {menu x y state} {
&& $index ne "none" \
&& $index ne $activeindex} {
set mode [option get $menu clickToFocus ClickToFocus]
- if {$mode eq "" || ([string is boolean $mode] && !$mode)} {
+ if {[string is false $mode]} {
set delay [expr {[$menu cget -type] eq "menubar" ? 0 : 50}]
- if {[$menu type $activeindex] eq "cascade"} {
- set Priv(menuDeactivatedTimer) \
- [after $delay [list $menu postcascade none]]
- }
if {[$menu type $index] eq "cascade"} {
set Priv(menuActivatedTimer) \
[after $delay [list $menu postcascade active]]
+ } else {
+ set Priv(menuDeactivatedTimer) \
+ [after $delay [list $menu postcascade none]]
}
}
}