summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgriffin <briang42@easystreet.net>2022-04-04 00:07:29 (GMT)
committergriffin <briang42@easystreet.net>2022-04-04 00:07:29 (GMT)
commit7ba1a60f171ee50181a238bc225ce5b99cd633fc (patch)
tree9671c89a69f06ca51a117fc9e96cebe7ba2f49ee
parent43cfbcbda332e1e6b93a41f0ac7a2c98be3bb1f6 (diff)
downloadtk-7ba1a60f171ee50181a238bc225ce5b99cd633fc.zip
tk-7ba1a60f171ee50181a238bc225ce5b99cd633fc.tar.gz
tk-7ba1a60f171ee50181a238bc225ce5b99cd633fc.tar.bz2
Fix for bug [29b5c28ea]
-rw-r--r--library/menu.tcl3
-rw-r--r--tests/menu.test22
2 files changed, 24 insertions, 1 deletions
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 {