summaryrefslogtreecommitdiffstats
path: root/tests/wm.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wm.test')
-rw-r--r--tests/wm.test303
1 files changed, 299 insertions, 4 deletions
diff --git a/tests/wm.test b/tests/wm.test
index a214581..3b86f86 100644
--- a/tests/wm.test
+++ b/tests/wm.test
@@ -7,7 +7,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: wm.test,v 1.33 2005/02/15 03:22:10 chengyemao Exp $
+# RCS: @(#) $Id: wm.test,v 1.34 2005/02/17 00:06:08 mdejong Exp $
# This file tests window manager interactions that work across
# platforms. Window manager tests that only work on a specific
@@ -116,13 +116,13 @@ test wm-attributes-1.1 {usage} {
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
test wm-attributes-1.2.1 {usage} win {
list [catch {wm attributes . _} err] $err
-} {1 {wrong # args: should be "wm attributes window ?-alpha ?double?? ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
+} {1 {wrong # args: should be "wm attributes window ?-alpha ?double?? ?-disabled ?bool?? ?-fullscreen ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
test wm-attributes-1.2.2 {usage} win {
list [catch {wm attributes . -alpha 1.0 -disabled} err] $err
-} {1 {wrong # args: should be "wm attributes window ?-alpha ?double?? ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
+} {1 {wrong # args: should be "wm attributes window ?-alpha ?double?? ?-disabled ?bool?? ?-fullscreen ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
test wm-attributes-1.2.3 {usage} win {
list [catch {wm attributes . -to} err] $err
-} {1 {wrong # args: should be "wm attributes window ?-alpha ?double?? ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
+} {1 {wrong # args: should be "wm attributes window ?-alpha ?double?? ?-disabled ?bool?? ?-fullscreen ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
test wm-attributes-1.2.4 {usage} unix {
list [catch {wm attributes . _} err] $err
} {1 {wrong # args: should be "wm attributes window"}}
@@ -146,6 +146,299 @@ test wm-client-2.1 {setting and reading values} {
} [list {} Miffo {}]
+test wm-attributes-1.3.0 {default -fullscreen value} {win} {
+ deleteWindows
+ toplevel .t
+ wm attributes .t -fullscreen
+} {0}
+
+test wm-attributes-1.3.1 {change -fullscreen before map} {win} {
+ deleteWindows
+ toplevel .t
+ wm attributes .t -fullscreen 1
+ wm attributes .t -fullscreen
+} {1}
+
+test wm-attributes-1.3.2 {change -fullscreen before map} {win} {
+ deleteWindows
+ toplevel .t
+ wm attributes .t -fullscreen 1
+ update
+ wm attributes .t -fullscreen
+} {1}
+
+test wm-attributes-1.3.3 {change -fullscreen after map} {win} {
+ deleteWindows
+ toplevel .t
+ update
+ wm attributes .t -fullscreen 1
+ wm attributes .t -fullscreen
+} {1}
+
+test wm-attributes-1.3.4 {change -fullscreen after map} {win} {
+ deleteWindows
+ toplevel .t
+ update
+ set booleans [list]
+ lappend booleans [wm attributes .t -fullscreen]
+ wm attributes .t -fullscreen 1
+ lappend booleans [wm attributes .t -fullscreen]
+ # Query above should not clear fullscreen state
+ lappend booleans [wm attributes .t -fullscreen]
+ wm attributes .t -fullscreen 0
+ lappend booleans [wm attributes .t -fullscreen]
+ set booleans
+} {0 1 1 0}
+
+test wm-attributes-1.3.5 {change -fullscreen after map} {win} {
+ deleteWindows
+ toplevel .t
+ set normal_geom "301x302+101+102"
+ set fullscreen_geom "[winfo screenwidth .t]x[winfo screenheight .t]+0+0"
+ wm geom .t $normal_geom
+ update
+ set results [list]
+ lappend results [string equal [wm geom .t] $normal_geom]
+ wm attributes .t -fullscreen 1
+ lappend results [string equal [wm geom .t] $fullscreen_geom]
+ wm attributes .t -fullscreen 0
+ lappend results [string equal [wm geom .t] $normal_geom]
+ set results
+} {1 1 1}
+
+test wm-attributes-1.3.6 {state change does not change -fullscreen} {win} {
+ deleteWindows
+ toplevel .t
+ update
+ wm attributes .t -fullscreen 1
+ wm withdraw .t
+ wm deiconify .t
+ wm attributes .t -fullscreen
+} {1}
+
+test wm-attributes-1.3.7 {state change does not change -fullscreen} {win} {
+ deleteWindows
+ toplevel .t
+ update
+ wm attributes .t -fullscreen 1
+ wm iconify .t
+ wm deiconify .t
+ wm attributes .t -fullscreen
+} {1}
+
+test wm-attributes-1.3.8 {override-redirect not compatible with fullscreen attribute} {win} {
+ deleteWindows
+ toplevel .t
+ update
+ wm overrideredirect .t 1
+ list [catch {wm attributes .t -fullscreen 1} err] $err
+} {1 {can't set fullscreen attribute for ".t": override-redirect flag is set}}
+
+test wm-attributes-1.3.9 {max height too small} {win} {
+ deleteWindows
+ toplevel .t
+ update
+ wm maxsize .t 5000 450
+ list [catch {wm attributes .t -fullscreen 1} err] $err
+} {1 {can't set fullscreen attribute for ".t": max width/height is too small}}
+
+test wm-attributes-1.3.10 {max height too small} {win} {
+ deleteWindows
+ toplevel .t
+ update
+ wm maxsize .t 450 5000
+ list [catch {wm attributes .t -fullscreen 1} err] $err
+} {1 {can't set fullscreen attribute for ".t": max width/height is too small}}
+
+test wm-attributes-1.3.11 {another attribute, then -fullscreen} {win} {
+ deleteWindows
+ toplevel .t
+ update
+ wm attributes .t -alpha 1.0 -fullscreen 1
+ wm attributes .t -fullscreen
+} 1
+
+test wm-attributes-1.3.12 {another attribute, then -fullscreen, then another} {win} {
+ deleteWindows
+ toplevel .t
+ update
+ wm attributes .t -toolwindow 0 -fullscreen 1 -topmost 0
+ wm attributes .t -fullscreen
+} 1
+
+test wm-attributes-1.4.0 {setting/unsetting fullscreen does not change the focus} {win} {
+ deleteWindows
+ focus -force .
+ toplevel .t
+ lower .t
+ update
+ set results [list]
+ lappend results [focus]
+
+ wm attributes .t -fullscreen 1
+ after 200 "set done 1" ; vwait done
+ lappend results [focus]
+
+ wm attributes .t -fullscreen 0
+ after 200 "set done 1" ; vwait done
+ lappend results [focus]
+
+ set results
+} {. . .}
+
+test wm-attributes-1.4.1 {setting fullscreen does not generate FocusIn on wrapper create} {win} {
+ deleteWindows
+ catch {unset focusin}
+ focus -force .
+ toplevel .t
+ pack [entry .t.e]
+ lower .t
+ bind .t <FocusIn> {lappend focusin %W}
+ after 200 "set done 1" ; vwait done
+
+ lappend focusin 1
+ focus -force .t.e
+ after 200 "set done 1" ; vwait done
+
+ lappend focusin 2
+ wm attributes .t -fullscreen 1
+ after 200 "set done 1" ; vwait done
+
+ lappend focusin 3
+ wm attributes .t -fullscreen 0
+ after 200 "set done 1" ; vwait done
+
+ lappend focusin final [focus]
+
+ bind . <FocusIn> {}
+ bind .t <FocusIn> {}
+ set focusin
+} {1 .t .t.e 2 3 final .t.e}
+
+test wm-attributes-1.5.0 {fullscreen stackorder} {win} {
+ deleteWindows
+ toplevel .t
+ set results [list]
+ lappend results [wm stackorder .]
+ after 200 "set done 1" ; vwait done
+ lappend results [wm stackorder .]
+
+ # Default stacking is on top of other windows
+ # on the display. Setting the fullscreen attribute
+ # does not change this.
+ wm attributes .t -fullscreen 1
+ after 200 "set done 1" ; vwait done
+ lappend results [wm stackorder .]
+
+ set results
+} {. {. .t} {. .t}}
+
+test wm-attributes-1.5.1 {fullscreen stackorder} {win} {
+ deleteWindows
+ toplevel .t
+ lower .t
+ after 200 "set done 1" ; vwait done
+ set results [list]
+ lappend results [wm stackorder .]
+
+ # If stacking order is explicitly set, then
+ # setting the fullscreen attribute should
+ # not change it.
+ wm attributes .t -fullscreen 1
+ after 200 "set done 1" ; vwait done
+ lappend results [wm stackorder .]
+
+ set results
+} {{.t .} {.t .}}
+
+test wm-attributes-1.5.2 {fullscreen stackorder} {win} {
+ deleteWindows
+ toplevel .t
+ # lower forces the window to be mapped, it would not be otherwise
+ lower .t
+ set results [list]
+ lappend results [wm stackorder .]
+
+ # If stacking order is explicitly set
+ # for an unmapped window, then setting
+ # the fullscreen attribute should
+ # not change it.
+ wm attributes .t -fullscreen 1
+ after 200 "set done 1" ; vwait done
+ lappend results [wm stackorder .]
+
+ set results
+} {{.t .} {.t .}}
+
+test wm-attributes-1.5.3 {fullscreen stackorder} {win} {
+ deleteWindows
+ toplevel .t
+ after 200 "set done 1" ; vwait done
+ set results [list]
+ lappend results [wm stackorder .]
+
+ wm attributes .t -fullscreen 1
+ after 200 "set done 1" ; vwait done
+ lappend results [wm stackorder .]
+
+ # Unsetting the fullscreen attribute
+ # should not change the stackorder.
+ wm attributes .t -fullscreen 0
+ after 200 "set done 1" ; vwait done
+ lappend results [wm stackorder .]
+
+ set results
+} {{. .t} {. .t} {. .t}}
+
+test wm-attributes-1.5.4 {fullscreen stackorder} {win} {
+ deleteWindows
+ toplevel .t
+ lower .t
+ after 200 "set done 1" ; vwait done
+ set results [list]
+ lappend results [wm stackorder .]
+
+ wm attributes .t -fullscreen 1
+ after 200 "set done 1" ; vwait done
+ lappend results [wm stackorder .]
+
+ # Unsetting the fullscreen attribute
+ # should not change the stackorder.
+ wm attributes .t -fullscreen 0
+ after 200 "set done 1" ; vwait done
+ lappend results [wm stackorder .]
+
+ set results
+} {{.t .} {.t .} {.t .}}
+
+test wm-attributes-1.5.5 {fullscreen stackorder} {win} {
+ deleteWindows
+ toplevel .a
+ toplevel .b
+ toplevel .c
+ raise .a
+ raise .b
+ raise .c
+ after 200 "set done 1" ; vwait done
+ set results [list]
+ lappend results [wm stackorder .]
+
+ wm attributes .b -fullscreen 1
+ after 200 "set done 1" ; vwait done
+ lappend results [wm stackorder .]
+
+ # Unsetting the fullscreen attribute
+ # should not change the stackorder.
+ wm attributes .b -fullscreen 0
+ after 200 "set done 1" ; vwait done
+ lappend results [wm stackorder .]
+
+ set results
+} {{. .a .b .c} {. .a .b .c} {. .a .b .c}}
+
+deleteWindows
+stdWindow
+
### wm colormapwindows ###
test wm-colormapwindows-1.1 {usage} {
list [catch {wm colormapwindows} err] $err
@@ -1741,5 +2034,7 @@ test wm-deletion-epoch-1.1 {Deletion epoch on multiple displays} -constraints al
deleteWindows
cleanupTests
+catch {unset results}
+catch {unset focusin}
return