summaryrefslogtreecommitdiffstats
path: root/library/tearoff.tcl
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2011-03-16 23:47:05 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2011-03-16 23:47:05 (GMT)
commit8201f9a9e37a538a0292247b524c7db7bb8115cd (patch)
treec35045801ddafb6e24be5efd655ba357d60c2696 /library/tearoff.tcl
parent277cd83817f5448b69f54b530ca4f65be299cb41 (diff)
downloadtk-8201f9a9e37a538a0292247b524c7db7bb8115cd.zip
tk-8201f9a9e37a538a0292247b524c7db7bb8115cd.tar.gz
tk-8201f9a9e37a538a0292247b524c7db7bb8115cd.tar.bz2
[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 <patthoyts@users.sourceforge.net>
Diffstat (limited to 'library/tearoff.tcl')
-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
}