summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2004-10-29 11:16:36 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2004-10-29 11:16:36 (GMT)
commit5278e46f9811b59aaf911438e7e64eb1e2f724df (patch)
tree1e4af3bcff77bf1fc8f8ddfde6b5f88c479d84d2
parent70d54a09579e6ba0eff888157870673a676cfa4c (diff)
downloadtk-5278e46f9811b59aaf911438e7e64eb1e2f724df.zip
tk-5278e46f9811b59aaf911438e7e64eb1e2f724df.tar.gz
tk-5278e46f9811b59aaf911438e7e64eb1e2f724df.tar.bz2
* library/tk.tcl (::tk::PlaceWindow): Backported the fix from
#533519 to handle window placement on multi-monitor Windows.
-rw-r--r--ChangeLog5
-rw-r--r--library/tk.tcl8
-rw-r--r--tests/winMenu.test14
3 files changed, 12 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 15b1c02..300169bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-29 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * library/tk.tcl (::tk::PlaceWindow): Backported the fix from
+ #533519 to handle window placement on multi-monitor Windows.
+
2004-10-28 Mo DeJong <mdejong@users.sourceforge.net>
* doc/wm.n: Add wm attributes . -alpha doc to account
diff --git a/library/tk.tcl b/library/tk.tcl
index 0d5b2ed..57c6926 100644
--- a/library/tk.tcl
+++ b/library/tk.tcl
@@ -3,7 +3,7 @@
# Initialization script normally executed in the interpreter for each
# Tk-based application. Arranges class bindings for widgets.
#
-# RCS: @(#) $Id: tk.tcl,v 1.46.2.1 2003/10/28 15:59:34 dkf Exp $
+# RCS: @(#) $Id: tk.tcl,v 1.46.2.2 2004/10/29 11:16:37 patthoyts Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
@@ -79,7 +79,7 @@ proc ::tk::PlaceWindow {w {place ""} {anchor ""}} {
wm withdraw $w
update idletasks
set checkBounds 1
- if {[string equal $place ""]} {
+ if {$place eq ""} {
set x [expr {([winfo screenwidth $w]-[winfo reqwidth $w])/2}]
set y [expr {([winfo screenheight $w]-[winfo reqheight $w])/2}]
set checkBounds 0
@@ -104,6 +104,10 @@ proc ::tk::PlaceWindow {w {place ""} {anchor ""}} {
set y [expr {([winfo screenheight $w]-[winfo reqheight $w])/2}]
set checkBounds 0
}
+ if {[tk windowingsystem] eq "win32"} {
+ # Bug 533519: win32 multiple desktops may produce negative geometry.
+ set checkBounds 0
+ }
if {$checkBounds} {
if {$x < 0} {
set x 0
diff --git a/tests/winMenu.test b/tests/winMenu.test
index 9e79c33..17a690b 100644
--- a/tests/winMenu.test
+++ b/tests/winMenu.test
@@ -7,7 +7,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: winMenu.test,v 1.6 2002/07/13 20:28:36 dgp Exp $
+# RCS: @(#) $Id: winMenu.test,v 1.6.2.1 2004/10/29 11:16:38 patthoyts Exp $
package require tcltest 2.1
namespace import -force tcltest::configure
@@ -1037,15 +1037,3 @@ test winMenu-34.1 {TkpMenuInit called at boot time} {emptyTest pcOnly} {} {}
deleteWindows
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-