From 8201f9a9e37a538a0292247b524c7db7bb8115cd 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 --- 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