summaryrefslogtreecommitdiffstats
path: root/tests/unixWm.test
diff options
context:
space:
mode:
authormdejong <mdejong>2003-03-12 00:25:40 (GMT)
committermdejong <mdejong>2003-03-12 00:25:40 (GMT)
commit5fa0b916e1a1c47c2251286bd3aad486bb08238b (patch)
tree1c5f6fc421347a2e042b8056bdecab04a447614a /tests/unixWm.test
parent6be1cd95fff709a3869038db3e989865154259fb (diff)
downloadtk-5fa0b916e1a1c47c2251286bd3aad486bb08238b.zip
tk-5fa0b916e1a1c47c2251286bd3aad486bb08238b.tar.gz
tk-5fa0b916e1a1c47c2251286bd3aad486bb08238b.tar.bz2
* doc/wm.n (minimize, maximize): Remove claim
that the resizable command keeps scripts from changing the size of windows since it is not true. The resizable command only applies to user sizing via user interaction. * tests/unixWm.test: Replace broken tests with the nonPortable constraint with new tests for maxsize and minsize options. These tests verify that setting the minsize and maxsize will resize the window if needed, and that the wm hints will be updated with the new sizes. * tests/wm.test: Add an exhaustive set of tests for the wm maxsize and wm minsize commands. These tests verify that setting the minsize and maxsize will resize the window if needed. These tests have only been run under Win98 and Window Maker under Linux, so further tweaking may be needed for other systems. * unix/tkUnixWm.c (UpdateGeometryInfo, UpdateSizeHints): Fixup comments and initialization for the minWidth, minHeight, maxWidth, maxHeight, width, and height members of the WmInfo struct. Check to ensure that a new toplevel window size is not larger than the maxsize or smaller than the minsize when updating the geometry at idle time. Pass new width and height values to the UpdateSizeHints method so that it can properly set the window min and max sizes for a window that cannot be resized by the user. This fixes a bug where the window resizes back to the original size when the user clicks on the window border. * win/tkWinWm.c (UpdateGeometryInfo): Fixup comments and initialization for the minWidth, minHeight, maxWidth, maxHeight, width, and height members of the WmInfo struct. Check to ensure that a new toplevel window size is not larger than the maxsize or smaller than the minsize when updating the geometry at idle time. [Patch 568861]
Diffstat (limited to 'tests/unixWm.test')
-rw-r--r--tests/unixWm.test92
1 files changed, 70 insertions, 22 deletions
diff --git a/tests/unixWm.test b/tests/unixWm.test
index 4bb5379..9c77197 100644
--- a/tests/unixWm.test
+++ b/tests/unixWm.test
@@ -7,7 +7,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: unixWm.test,v 1.29 2002/11/07 22:27:04 mdejong Exp $
+# RCS: @(#) $Id: unixWm.test,v 1.30 2003/03/12 00:25:41 mdejong Exp $
package require tcltest 2.2
namespace import -force tcltest::configure
@@ -988,35 +988,83 @@ test unixWm-27.7 {Tk_WmCmd procedure, "iconwindow" option, withdrawing icon} {
set result
} {normal 1 icon 0}
-test unixWm-28.1 {Tk_WmCmd procedure, "maxsize" option} {nonPortable} {
- wm maxsize .t
-} {1137 870}
-
-test unixWm-28.2 {Tk_WmCmd procedure, "maxsize" option} {nonPortable} {
- # Not portable, because some window managers let applications override
- # minsize and maxsize.
-
- wm maxsize .t 200 150
- wm geom .t 300x200
- update
- list [winfo width .t] [winfo height .t]
-} {200 150}
-
catch {destroy .t}
catch {destroy .icon}
toplevel .t -width 100 -height 50
wm geom .t +0+0
update
-test unixWm-29.1 {Tk_WmCmd procedure, "minsize" option} {nonPortable} {
- # Not portable, because some window managers let applications override
- # minsize and maxsize.
+test unixWm-28.1 {Tk_WmCmd procedure, "maxsize" option, setting the
+ maxsize should update WM_NORMAL_HINTS} {
+ destroy .t
+ toplevel .t
+ wm maxsize .t 300 300
+ update
+ set hints [testprop [testwrapper .t] WM_NORMAL_HINTS]
+ format {%d %d} [lindex $hints 7] [lindex $hints 8]
+} {300 300}
- wm minsize .t 150 100
- wm geom .t 50x50
+test unixWm-28.2 {Tk_WmCmd procedure, "maxsize" option, setting the
+ maxsize to a value smaller than the current size should
+ set the maxsize in WM_NORMAL_HINTS} {
+ destroy .t
+ toplevel .t
+ wm geom .t 400x400
+ wm maxsize .t 300 300
update
- list [winfo width .t] [winfo height .t]
-} {150 100}
+ set hints [testprop [testwrapper .t] WM_NORMAL_HINTS]
+ format {%d %d} [lindex $hints 7] [lindex $hints 8]
+} {300 300}
+
+test unixWm-28.3 {Tk_WmCmd procedure, "maxsize" option, setting the
+ maxsize to a value smaller than the current size should
+ set the maxsize in WM_NORMAL_HINTS even if the
+ interactive resizable flag is set to 0} {
+ destroy .t
+ toplevel .t
+ wm geom .t 400x400
+ wm resizable .t 0 0
+ wm maxsize .t 300 300
+ update
+ set hints [testprop [testwrapper .t] WM_NORMAL_HINTS]
+ format {%d %d} [lindex $hints 7] [lindex $hints 8]
+} {300 300}
+
+test unixWm-29.1 {Tk_WmCmd procedure, "minsize" option, setting the
+ minsize should update WM_NORMAL_HINTS} {
+ destroy .t
+ toplevel .t
+ wm minsize .t 300 300
+ update
+ set hints [testprop [testwrapper .t] WM_NORMAL_HINTS]
+ format {%d %d} [lindex $hints 5] [lindex $hints 6]
+} {300 300}
+
+test unixWm-29.2 {Tk_WmCmd procedure, "minsize" option, setting the
+ minsize to a value larger than the current size should
+ set the maxsize in WM_NORMAL_HINTS} {
+ destroy .t
+ toplevel .t
+ wm geom .t 200x200
+ wm minsize .t 300 300
+ update
+ set hints [testprop [testwrapper .t] WM_NORMAL_HINTS]
+ format {%d %d} [lindex $hints 5] [lindex $hints 6]
+} {300 300}
+
+test unixWm-29.3 {Tk_WmCmd procedure, "minsize" option, setting the
+ minsize to a value larger than the current size should
+ set the minsize in WM_NORMAL_HINTS even if the
+ interactive resizable flag is set to 0} {
+ destroy .t
+ toplevel .t
+ wm geom .t 200x200
+ wm resizable .t 0 0
+ wm minsize .t 300 300
+ update
+ set hints [testprop [testwrapper .t] WM_NORMAL_HINTS]
+ format {%d %d} [lindex $hints 5] [lindex $hints 6]
+} {300 300}
catch {destroy .t}
catch {destroy .icon}