summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
Diffstat (limited to 'library')
-rw-r--r--library/tearoff.tcl5
1 files changed, 5 insertions, 0 deletions
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
}