From 7ba1a60f171ee50181a238bc225ce5b99cd633fc Mon Sep 17 00:00:00 2001 From: griffin Date: Mon, 4 Apr 2022 00:07:29 +0000 Subject: Fix for bug [29b5c28ea] --- library/menu.tcl | 3 ++- tests/menu.test | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/library/menu.tcl b/library/menu.tcl index 20b461c..821725a 100644 --- a/library/menu.tcl +++ b/library/menu.tcl @@ -1236,7 +1236,8 @@ if {[tk windowingsystem] ne "win32"} { proc ::tk::PostOverPoint {menu x y {entry {}}} { if {$entry ne ""} { $menu post $x $y $entry - if {[$menu entrycget $entry -state] ne "disabled"} { + if {[$menu type $entry] ni {separator tearoff} && + [$menu entrycget $entry -state] ne "disabled"} { $menu activate $entry GenerateMenuSelect $menu } diff --git a/tests/menu.test b/tests/menu.test index 4993761..07cec7d 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -3436,6 +3436,28 @@ test menu-22.5 {GetIndexFromCoords: mapped wide window} -setup { deleteWindows } -result 0 +test menu-22.6 {tk_popup on separator entry} -setup { + deleteWindows +} -constraints {x11} -body { + menu .m1 + label .l -text ClickMe! + .m1 add command -label "Example 1" -command bell + .m1 add command -label "Example 2" -command bell + .m1 add separator + .m1 add command -label "Example Other" -command "bell;bell" + tk_popup .m1 100 100 2 + set waiting 0 + tkwait visibility .m1 + after 333 incr waiting + vwait waiting + .m1 invoke 4 + after 333 incr waiting + vwait waiting + destroy .m1 +} -cleanup { + deleteWindows +} -result {} + test menu-23.1 {RecursivelyDeleteMenu} -setup { deleteWindows } -body { -- cgit v0.12