summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2011-03-16 23:51:28 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2011-03-16 23:51:28 (GMT)
commitb65b33796f21432b49507efd59385268d77045f4 (patch)
tree539b75fc4788178fe001f1a00e91af0f91dd1fef
parentdbd0309f145a61f296c7a7da2262b3f2d989ddfc (diff)
parent8201f9a9e37a538a0292247b524c7db7bb8115cd (diff)
downloadtk-b65b33796f21432b49507efd59385268d77045f4.zip
tk-b65b33796f21432b49507efd59385268d77045f4.tar.gz
tk-b65b33796f21432b49507efd59385268d77045f4.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>
-rw-r--r--library/tearoff.tcl5
1 files changed, 5 insertions, 0 deletions
diff --git a/library/tearoff.tcl b/library/tearoff.tcl
index 3a99a2d..46e442d 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
}