diff options
author | patthoyts <patthoyts@noemail.net> | 2011-04-30 22:29:49 (GMT) |
---|---|---|
committer | patthoyts <patthoyts@noemail.net> | 2011-04-30 22:29:49 (GMT) |
commit | e6afe7a7f717ba09a99b91d382b26807bff19664 (patch) | |
tree | 16dd6070902ecdc868ec7e34f5efa9756bcc04f0 /library | |
parent | b601d3f38a58bb7b2b9aa29bfc8367be52d1b185 (diff) | |
download | tk-e6afe7a7f717ba09a99b91d382b26807bff19664.zip tk-e6afe7a7f717ba09a99b91d382b26807bff19664.tar.gz tk-e6afe7a7f717ba09a99b91d382b26807bff19664.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>
FossilOrigin-Name: a337b2c440b7201e2864e824116366caa1f8833d
Diffstat (limited to 'library')
-rw-r--r-- | library/menu.tcl | 9 |
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]] } } } |