summaryrefslogtreecommitdiffstats
path: root/library/tk.tcl
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-20 12:27:15 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-20 12:27:15 (GMT)
commit48618f68cf19963ba025756c77672298c47b804c (patch)
tree67282c401e49141494e4c57d279601278e19b21c /library/tk.tcl
parent29090f7e122f08f970ad2970f6fedb5fd681192c (diff)
parent72dea207ae279d05cfa07445b767e0efb4bb6702 (diff)
downloadtk-48618f68cf19963ba025756c77672298c47b804c.zip
tk-48618f68cf19963ba025756c77672298c47b804c.tar.gz
tk-48618f68cf19963ba025756c77672298c47b804c.tar.bz2
Use vroot size in stead of screen size for clipping window coordinates in ::tk::PlaceWindow.
Use ::tk::PlaceWindow in dialog.tcl, in stead of dumplicating the code there.
Diffstat (limited to 'library/tk.tcl')
-rw-r--r--library/tk.tcl17
1 files changed, 9 insertions, 8 deletions
diff --git a/library/tk.tcl b/library/tk.tcl
index 5e6f4a6..b259240 100644
--- a/library/tk.tcl
+++ b/library/tk.tcl
@@ -116,15 +116,15 @@ proc ::tk::PlaceWindow {w {place ""} {anchor ""}} {
set checkBounds 0
}
if {$checkBounds} {
- if {$x < 0} {
- set x 0
- } elseif {$x > ([winfo screenwidth $w]-[winfo reqwidth $w])} {
- set x [expr {[winfo screenwidth $w]-[winfo reqwidth $w]}]
+ if {$x < [winfo vrootx $w]} {
+ set x [winfo vrootx $w]
+ } elseif {$x > ([winfo vrootx $w]+[winfo vrootwidth $w]-[winfo reqwidth $w])} {
+ set x [expr {[winfo vrootx $w]+[winfo vrootwidth $w]-[winfo reqwidth $w]}]
}
- if {$y < 0} {
- set y 0
- } elseif {$y > ([winfo screenheight $w]-[winfo reqheight $w])} {
- set y [expr {[winfo screenheight $w]-[winfo reqheight $w]}]
+ if {$y < [winfo vrooty $w]} {
+ set y [winfo vrooty $w]
+ } elseif {$y > ([winfo vrooty $w]+[winfo vrootheight $w]-[winfo reqheight $w])} {
+ set y [expr {[winfo vrooty $w]+[winfo vrootheight $w]-[winfo reqheight $w]}]
}
if {[tk windowingsystem] eq "aqua"} {
# Avoid the native menu bar which sits on top of everything.
@@ -133,6 +133,7 @@ proc ::tk::PlaceWindow {w {place ""} {anchor ""}} {
}
}
}
+ wm maxsize $w [winfo vrootwidth $w] [winfo vrootheight $w]
wm geometry $w +$x+$y
wm deiconify $w
}