summaryrefslogtreecommitdiffstats
path: root/library/tk.tcl
diff options
context:
space:
mode:
authorjan.nijtmans <jan.nijtmans@noemail.net>2012-04-20 12:16:36 (GMT)
committerjan.nijtmans <jan.nijtmans@noemail.net>2012-04-20 12:16:36 (GMT)
commit3e00862b3df07806b0b499711a83b23f88fcafbc (patch)
treeb6b2163dafeff1c9a7328e67b75329e8a9f4ff83 /library/tk.tcl
parentd054e30438b53eca86150e549cf17bec6b0b55b1 (diff)
parentab01eb4abe8b8e682064c5ce365437761ee39737 (diff)
downloadtk-3e00862b3df07806b0b499711a83b23f88fcafbc.zip
tk-3e00862b3df07806b0b499711a83b23f88fcafbc.tar.gz
tk-3e00862b3df07806b0b499711a83b23f88fcafbc.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. FossilOrigin-Name: 53c95a25edfe3f718d6b4c99e6f32e372433c5b5
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 b9c3872..90a4d0c 100644
--- a/library/tk.tcl
+++ b/library/tk.tcl
@@ -111,21 +111,22 @@ 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 {$windowingsystem eq "classic" || $windowingsystem eq "aqua"} {
# Avoid the native menu bar which sits on top of everything.
if {$y < 22} { set y 22 }
}
}
+ wm maxsize $w [winfo vrootwidth $w] [winfo vrootheight $w]
wm geometry $w +$x+$y
wm deiconify $w
}