From 8bd5cf46f53712c5c4ee5dd8f1cfbbf761075bb0 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Sat, 30 Apr 2011 22:29:49 +0000 Subject: [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 Signed-off-by: Pat Thoyts --- library/menu.tcl | 9 ++++----- 1 file 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]] } } } -- cgit v0.12