From 527676f93b7d241d6cb2c9ba0a98e71c304b8d54 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Wed, 16 Mar 2011 23:47:05 +0000 Subject: [Bug 3181181] tearoff sub-menu windows not being shown on Windows. Commit f59e9722e9 changed tearoff menu windows to be transient toolwindow toplevels. However the hidden menu hierarchy confuses the toplevel search when the menu being torn off is a submenu and not a direct child of the menubar. This patch fixes the search to exclude these hidden menu windows. Signed-off-by: Pat Thoyts FossilOrigin-Name: 8c54d46c732f7f0c4fd966eb87583cc4704a7085 --- library/tearoff.tcl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/tearoff.tcl b/library/tearoff.tcl index e5ab02d..8f166ce 100644 --- a/library/tearoff.tcl +++ b/library/tearoff.tcl @@ -81,6 +81,11 @@ proc ::tk::TearOffMenu {w {x 0} {y 0}} { } if {[tk windowingsystem] eq "win32"} { + # [Bug 3181181]: Find the toplevel window for the menu + set parent [winfo toplevel $parent] + while {[winfo class $parent] eq "Menu"} { + set parent [winfo toplevel [winfo parent $parent]] + } wm transient $menu [winfo toplevel $parent] wm attributes $menu -toolwindow 1 } -- cgit v0.12