summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@noemail.net>2011-03-16 23:47:05 (GMT)
committerpatthoyts <patthoyts@noemail.net>2011-03-16 23:47:05 (GMT)
commit527676f93b7d241d6cb2c9ba0a98e71c304b8d54 (patch)
treec35045801ddafb6e24be5efd655ba357d60c2696 /library
parent8e8ee48a40bb094939478af11ff293d3d932203b (diff)
downloadtk-527676f93b7d241d6cb2c9ba0a98e71c304b8d54.zip
tk-527676f93b7d241d6cb2c9ba0a98e71c304b8d54.tar.gz
tk-527676f93b7d241d6cb2c9ba0a98e71c304b8d54.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> FossilOrigin-Name: 8c54d46c732f7f0c4fd966eb87583cc4704a7085
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
}