summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorculler <culler>2020-07-27 16:23:03 (GMT)
committerculler <culler>2020-07-27 16:23:03 (GMT)
commit916ea258d01119b9f5e02836ac8a92c4d6c4f520 (patch)
treee9884c36ffcda550c18a67ce7e8ac669ad9199e9
parentbcbf366541cf894a8abaaea4c684ff551c54981c (diff)
parent2c481a8b318d561e9941bd5152601d5957f2b443 (diff)
downloadtk-916ea258d01119b9f5e02836ac8a92c4d6c4f520.zip
tk-916ea258d01119b9f5e02836ac8a92c4d6c4f520.tar.gz
tk-916ea258d01119b9f5e02836ac8a92c4d6c4f520.tar.bz2
Merge mac_testing: fix testing and build issues on the various supported versions of macOS.
-rw-r--r--generic/tkTest.c64
-rw-r--r--library/demos/fontchoose.tcl6
-rw-r--r--macosx/tkMacOSXColor.c21
-rw-r--r--macosx/tkMacOSXDraw.c5
-rw-r--r--macosx/tkMacOSXInit.c1
-rw-r--r--macosx/tkMacOSXKeyEvent.c2
-rw-r--r--macosx/tkMacOSXNotify.c2
-rw-r--r--macosx/tkMacOSXSubwindows.c20
-rw-r--r--macosx/tkMacOSXTest.c30
-rw-r--r--macosx/tkMacOSXWm.c23
-rw-r--r--tests/canvImg.test23
-rw-r--r--tests/entry.test27
-rw-r--r--tests/listbox.test28
-rw-r--r--tests/pack.test23
-rw-r--r--tests/place.test23
-rw-r--r--tests/spinbox.test38
-rw-r--r--tests/textDisp.test30
-rw-r--r--tests/ttk/spinbox.test9
-rw-r--r--tests/unixWm.test56
-rw-r--r--tests/wm.test20
20 files changed, 252 insertions, 199 deletions
diff --git a/generic/tkTest.c b/generic/tkTest.c
index e80f488..c22e649 100644
--- a/generic/tkTest.c
+++ b/generic/tkTest.c
@@ -71,6 +71,8 @@ typedef struct TImageInstance {
TImageMaster *masterPtr; /* Pointer to master for image. */
XColor *fg; /* Foreground color for drawing in image. */
GC gc; /* Graphics context for drawing in image. */
+ Bool displayFailed; /* macOS display attempted out of drawRect. */
+ char buffer[200 + TCL_INTEGER_SPACE * 6]; /* message to log on display. */
} TImageInstance;
/*
@@ -1517,6 +1519,7 @@ ImageGet(
instPtr->fg = Tk_GetColor(timPtr->interp, tkwin, "#ff0000");
gcValues.foreground = instPtr->fg->pixel;
instPtr->gc = Tk_GetGC(tkwin, GCForeground, &gcValues);
+ instPtr->displayFailed = False;
return instPtr;
}
@@ -1551,41 +1554,50 @@ ImageDisplay(
* imageX and imageY. */
{
TImageInstance *instPtr = (TImageInstance *) clientData;
- char buffer[200 + TCL_INTEGER_SPACE * 6];
/*
* The purpose of the test image type is to track the calls to an image
- * display proc and record the parameters passed in each call. On macOS
- * a display proc must be run inside of the drawRect method of an NSView
- * in order for the graphics operations to have any effect. To deal with
+ * display proc and record the parameters passed in each call. On macOS a
+ * display proc must be run inside of the drawRect method of an NSView in
+ * order for the graphics operations to have any effect. To deal with
* this, whenever a display proc is called outside of any drawRect method
- * it schedules a redraw of the NSView by calling [view setNeedsDisplay:YES].
- * This will trigger a later call to the view's drawRect method which will
- * run the display proc a second time.
+ * it schedules a redraw of the NSView.
*
- * This complicates testing, since it can result in more calls to the display
- * proc than are expected by the test. It can also result in an inconsistent
- * number of calls unless the test waits until the call to drawRect actually
- * occurs before validating its results.
- *
- * In an attempt to work around this, this display proc only logs those
- * calls which occur within a drawRect method. This means that tests must
- * be written so as to ensure that the drawRect method is run before
- * results are validated. In practice it usually suffices to run update
- * idletasks (to run the display proc the first time) followed by update
- * (to run the display proc in drawRect).
- *
- * This also has the consequence that the image changed command will log
- * different results on Aqua than on other systems, because when the image
- * is redisplayed in the drawRect method the entire image will be drawn,
- * not just the changed portion. Tests must account for this.
+ * In an attempt to work around this, each image instance maintains it own
+ * copy of the log message which gets written on the first call to the
+ * display proc. This usually means that the message created on macOS is
+ * the same as that created on other platforms. However it is possible
+ * for the messages to differ for other reasons, namely differences in
+ * how damage regions are computed.
*/
if (LOG_DISPLAY(drawable)) {
- sprintf(buffer, "%s display %d %d %d %d",
- instPtr->masterPtr->imageName, imageX, imageY, width, height);
+ if (instPtr->displayFailed == False) {
+
+ /*
+ * Drawing is possible on the first call to DisplayImage.
+ * Log the message.
+ */
+
+ sprintf(instPtr->buffer, "%s display %d %d %d %d",
+ instPtr->masterPtr->imageName, imageX, imageY, width, height);
+ }
Tcl_SetVar2(instPtr->masterPtr->interp, instPtr->masterPtr->varName,
- NULL, buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
+ NULL, instPtr->buffer,
+ TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
+ instPtr->displayFailed = False;
+ } else {
+
+ /*
+ * Drawing is not possible on the first call to DisplayImage.
+ * Save the message, but do not log it until the actual display.
+ */
+
+ if (instPtr->displayFailed == False) {
+ sprintf(instPtr->buffer, "%s display %d %d %d %d",
+ instPtr->masterPtr->imageName, imageX, imageY, width, height);
+ }
+ instPtr->displayFailed = True;
}
if (width > (instPtr->masterPtr->width - imageX)) {
width = instPtr->masterPtr->width - imageX;
diff --git a/library/demos/fontchoose.tcl b/library/demos/fontchoose.tcl
index 8b34377..446ed34 100644
--- a/library/demos/fontchoose.tcl
+++ b/library/demos/fontchoose.tcl
@@ -55,10 +55,6 @@ grid $f.msg $f.vs -sticky news
grid $f.font - -sticky e
grid columnconfigure $f 0 -weight 1
grid rowconfigure $f 0 -weight 1
-bind $w <Visibility> {
- bind %W <Visibility> {}
- grid propagate %W.f 0
-}
## See Code / Dismiss buttons
set btns [addSeeDismiss $w.buttons $w]
@@ -67,3 +63,5 @@ grid $f -sticky news
grid $btns -sticky ew
grid columnconfigure $w 0 -weight 1
grid rowconfigure $w 0 -weight 1
+update idletasks
+grid propagate $f 0
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index a0eaa84..5a06c39 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -267,6 +267,22 @@ GetEntryFromPixelCode(
*----------------------------------------------------------------------
*/
+/*
+ * Apple claims that linkColor is available in 10.10 but the declaration
+ * does not appear in NSColor.h until later. Declaring it in a category
+ * appears to be harmless and stops the compiler warnings.
+ */
+
+@interface NSColor(TkColor)
+#if MAC_OS_X_VERSION_MAX_ALLOWED > 101200
+@property(class, strong, readonly) NSColor *linkColor;
+#elif MAC_OS_X_VERSION_MAX_ALLOWED > 1080
+@property(strong, readonly) NSColor *linkColor;
+#else
+@property(assign, readonly) NSColor *linkColor;
+#endif
+@end
+
static NSColorSpace* sRGB = NULL;
static CGFloat windowBackground[4] =
{236.0 / 255, 236.0 / 255, 236.0 / 255, 1.0};
@@ -336,6 +352,7 @@ SetCGColorComponents(
break;
case 2:
if ([NSApp macOSVersion] > 100900) {
+
#if MAC_OS_X_VERSION_MAX_ALLOWED > 1090
color = [[NSColor labelColor] colorUsingColorSpace:sRGB];
#endif
@@ -378,8 +395,8 @@ SetCGColorComponents(
}
break;
case 9:
- if ([NSApp macOSVersion] >= 101000) {
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101000
+ if ([NSApp macOSVersion] >= 101100) {
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101100
color = [[NSColor linkColor] colorUsingColorSpace:sRGB];
#endif
} else {
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index 68e7ada..fd8a1eb 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -17,7 +17,7 @@
#include "tkMacOSXDebug.h"
#include "tkButton.h"
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101000
#define GET_CGCONTEXT [[NSGraphicsContext currentContext] CGContext]
#else
#define GET_CGCONTEXT [[NSGraphicsContext currentContext] graphicsPort]
@@ -1666,8 +1666,7 @@ TkMacOSXSetupDrawingContext(
* cycle.
*/
- CGRect currentClip = CGContextGetClipBoundingBox(
- [NSGraphicsContext currentContext].CGContext);
+ CGRect currentClip = CGContextGetClipBoundingBox(GET_CGCONTEXT);
if (!NSContainsRect(currentClip, clipBounds)) {
[view addTkDirtyRect:clipBounds];
}
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index e75a63c..d3c4a0c 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -34,6 +34,7 @@ static char scriptPath[PATH_MAX + 1] = "";
@synthesize poolLock = _poolLock;
@synthesize macOSVersion = _macOSVersion;
@synthesize isDrawing = _isDrawing;
+@synthesize needsToDraw = _needsToDraw;
@end
/*
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c
index 572e318..014caa9 100644
--- a/macosx/tkMacOSXKeyEvent.c
+++ b/macosx/tkMacOSXKeyEvent.c
@@ -267,6 +267,8 @@ static NSUInteger textInputModifiers;
@implementation TKContentView
+@synthesize tkDirtyRect = _tkDirtyRect;
+@synthesize tkNeedsDisplay = _tkNeedsDisplay;;
/*
* Implementation of the NSTextInputClient protocol.
diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c
index 367f3b6..83b4695 100644
--- a/macosx/tkMacOSXNotify.c
+++ b/macosx/tkMacOSXNotify.c
@@ -156,6 +156,7 @@ void DebugPrintQueue(void)
* this block should be removed.
*/
+# if MAC_OSX_VERSION_MAX_ALLOWED >= 101500
if ([theEvent type] == NSAppKitDefined) {
static Bool aWindowIsMoving = NO;
switch([theEvent subtype]) {
@@ -174,6 +175,7 @@ void DebugPrintQueue(void)
break;
}
}
+#endif
[super sendEvent:theEvent];
[NSApp tkCheckPasteboard];
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c
index 8bae8fd..a58bab4 100644
--- a/macosx/tkMacOSXSubwindows.c
+++ b/macosx/tkMacOSXSubwindows.c
@@ -205,7 +205,15 @@ XMapWindow(
event.xmap.type = MapNotify;
event.xmap.event = window;
event.xmap.override_redirect = winPtr->atts.override_redirect;
- Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+
+ /*
+ * To update the mapped status of packed or placed subwindows
+ * we handle this event immediately and then process the idle
+ * events that it generates.
+ */
+
+ Tk_HandleEvent(&event);
+ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {}
} else {
/*
@@ -315,7 +323,15 @@ XUnmapWindow(
event.xunmap.window = window;
event.xunmap.event = window;
event.xunmap.from_configure = false;
- Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+
+ /*
+ * To update the mapped status of packed or placed subwindows
+ * we handle this event immediately and then process the idle
+ * events that it generates.
+ */
+
+ Tk_HandleEvent(&event);
+ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {}
} else {
/*
* Rebuild the visRgn clip region for the parent so it will be allowed
diff --git a/macosx/tkMacOSXTest.c b/macosx/tkMacOSXTest.c
index 0a6f4e8..e5dcf5e 100644
--- a/macosx/tkMacOSXTest.c
+++ b/macosx/tkMacOSXTest.c
@@ -136,19 +136,12 @@ MenuBarHeightObjCmd(
* TkTestLogDisplay --
*
* The test image display procedure calls this to determine whether it
- * should write a log message recording that it has being run. On OSX
- * 10.14 and later, only calls to the display procedure which occur inside
- * of the drawRect method should be logged, since those are the only ones
- * which actually draw anything. On earlier systems the opposite is true.
- * The calls from within the drawRect method are redundant, since the
- * first time the display procedure is run it will do the drawing and that
- * first call will usually not occur inside of drawRect.
+ * should write a log message recording that it has being run.
*
* Results:
- * On OSX 10.14 and later, returns true if and only if the NSView of the
- * drawable is the current focusView, which can only be the case when
- * within [NSView drawRect]. On earlier systems returns false if
- * and only if called from with [NSView drawRect].
+ * Returns true if and only if the NSView of the drawable is the
+ * current focusView, which on 10.14 and newer systems can only be the
+ * case when within [NSView drawRect].
*
* Side effects:
* None
@@ -168,18 +161,11 @@ TkTestLogDisplay(
} else if (macWin->winPtr && macWin->winPtr->wmInfoPtr &&
macWin->winPtr->wmInfoPtr->window) {
win = macWin->winPtr->wmInfoPtr->window;
- }/*
- else if (macWin->toplevel && (macWin->toplevel->flags & TK_EMBEDDED)) {
- TkWindow *contWinPtr = TkpGetOtherWindow(macWin->toplevel->winPtr);
- if (contWinPtr) {
- win = TkMacOSXDrawableWindow((Drawable) contWinPtr->privatePtr);
- }
- }*/
- if (win && [NSApp macOSVersion] >= 101400) {
- TKContentView *view = [win contentView];
- return (view == [NSView focusView]);
+ }
+ if (win) {
+ return ([win contentView] == [NSView focusView]);
} else {
- return ![NSApp isDrawing];
+ return True;
}
}
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index dca8686..90e4a70 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -1807,7 +1807,6 @@ WmDeiconifyCmd(
Tcl_WrongNumArgs(interp, 2, objv, "window");
return TCL_ERROR;
}
-
if (wmPtr->iconFor != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't deiconify %s: it is an icon for %s",
@@ -6422,17 +6421,15 @@ TkpWmSetState(
Tk_UnmapWindow((Tk_Window) winPtr);
} else if (state == NormalState || state == ZoomState) {
Tk_MapWindow((Tk_Window) winPtr);
- if (macWin && ([macWin styleMask] & NSMiniaturizableWindowMask)) {
- if ([macWin isMiniaturized]) {
- [macWin deminiaturize:NSApp];
- }
- else {
- [macWin orderFront:nil];
- }
- }
- TkMacOSXZoomToplevel(macWin, state == NormalState ? inZoomIn :
- inZoomOut);
+ [macWin deminiaturize:NSApp];
+ [macWin orderFront:NSApp];
+ TkMacOSXZoomToplevel(macWin, state == NormalState ? inZoomIn : inZoomOut);
}
+ /*
+ * Make sure windows are updated after the state change.
+ */
+
+ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)){}
}
/*
@@ -6878,7 +6875,6 @@ ApplyWindowAttributeFlagChanges(
b |= (NSWindowCollectionBehaviorCanJoinAllSpaces |
NSWindowCollectionBehaviorFullScreenAuxiliary);
} else {
- NSSize screenSize = [[macWindow screen] frame].size;
b |= NSWindowCollectionBehaviorFullScreenPrimary;
/*
@@ -6889,7 +6885,10 @@ ApplyWindowAttributeFlagChanges(
* to the screen size. (For 10.11 and up, only)
*/
if ([NSApp macOSVersion] > 101000) {
+#if !(MAC_OS_X_VERSION_MAX_ALLOWED > 101000)
+ NSSize screenSize = [[macWindow screen] frame].size;
[macWindow setMaxFullScreenContentSize:screenSize];
+#endif
}
}
}
diff --git a/tests/canvImg.test b/tests/canvImg.test
index 1abea78..a3524f1 100644
--- a/tests/canvImg.test
+++ b/tests/canvImg.test
@@ -174,7 +174,7 @@ test canvImg-4.2 {ConfigureImage procedure} -constraints testImageType -setup {
while {"timed out" ni $y && [lindex $y end 1] ne "display"} {
vwait y
}
- after cancel timer
+ after cancel $timer
list $x $y [.c bbox i1]
} -cleanup {
.c delete all
@@ -739,7 +739,6 @@ test canvImg-10.1 {TranslateImage procedure} -constraints testImageType -setup {
foo changed 2 4 6 8 30 15
vwait x
after cancel $timer
- update
return $x
} -cleanup {
.c delete all
@@ -756,7 +755,7 @@ test canvImg-11.1 {TranslateImage procedure} -constraints testImageType -setup {
set x {}
set timer [after 500 {lappend x "timed out"}]
foo changed 2 4 6 8 40 50
- vwait x
+ vwait x
after cancel $timer
update
return $x
@@ -779,17 +778,12 @@ test canvImg-11.2 {ImageChangedProc procedure} -constraints {
.c delete all
image delete foo
} -result {30 75 70 125}
-if {[tk windowingsystem] == "aqua" && $tcl_platform(osVersion) > 18} {
- # Aqua >= 10.14 will redraw the entire image.
- set result_11_3 {{foo2 display 0 0 80 60}}
-} else {
- set result_11_3 {{foo2 display 0 0 20 40}}
-}
+
test canvImg-11.3 {ImageChangedProc procedure} -constraints {
testImageType
} -setup {
.c delete all
- update
+ update idletasks
} -body {
image create test foo -variable x
image create test foo2 -variable z
@@ -797,17 +791,16 @@ test canvImg-11.3 {ImageChangedProc procedure} -constraints {
foo2 changed 0 0 0 0 80 60
.c create image 50 100 -image foo -tags image -anchor nw
.c create image 70 110 -image foo2 -anchor nw
- update idletasks
set z {}
set timer [after 500 {lappend z "timed out"}]
- image create test foo -variable x
- vwait x
+ image delete foo
+ vwait z
after cancel $timer
return $z
} -cleanup {
.c delete all
- image delete foo foo2
-} -result $result_11_3
+ image delete foo2
+} -result {{foo2 display 0 0 80 60}}
# cleanup
imageFinish
diff --git a/tests/entry.test b/tests/entry.test
index f9879a2..8512b3f 100644
--- a/tests/entry.test
+++ b/tests/entry.test
@@ -12,6 +12,7 @@ eval tcltest::configure $argv
tcltest::loadTestedCommands
# For xscrollcommand
+set scrollInfo {}
proc scroll args {
global scrollInfo
set scrollInfo $args
@@ -1671,9 +1672,10 @@ test entry-5.7 {ConfigureEntry procedure} -setup {
} -body {
.e configure -font {Courier -12} -width 4 -xscrollcommand scroll
.e insert end "01234567890"
- set timeout [after 500 {set $scrollInfo "timeout"}]
- vwait scrollInfo
+ update idletasks
+ set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
.e configure -width 5
+ vwait scrollInfo
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
@@ -1916,9 +1918,9 @@ test entry-7.1 {InsertChars procedure} -setup {
focus .e
} -body {
.e configure -textvariable contents -xscrollcommand scroll
+ set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
.e insert 0 abcde
.e insert 2 XXX
- set timeout [after 500 {set $scrollInfo "timeout"}]
vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
@@ -1933,9 +1935,9 @@ test entry-7.2 {InsertChars procedure} -setup {
focus .e
} -body {
.e configure -textvariable contents -xscrollcommand scroll
+ set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
.e insert 0 abcde
.e insert 500 XXX
- set timeout [after 500 {set $scrollInfo "timeout"}]
vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
@@ -2067,9 +2069,9 @@ test entry-8.1 {DeleteChars procedure} -setup {
focus .e
} -body {
.e configure -textvariable contents -xscrollcommand scroll
+ set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
.e insert 0 abcde
.e delete 2 4
- set timeout [after 500 {set $scrollInfo "timeout"}]
vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
@@ -2083,9 +2085,9 @@ test entry-8.2 {DeleteChars procedure} -setup {
focus .e
} -body {
.e configure -textvariable contents -xscrollcommand scroll
+ set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
.e insert 0 abcde
.e delete -2 2
- set timeout [after 500 {set $scrollInfo "timeout"}]
vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
@@ -2099,9 +2101,9 @@ test entry-8.3 {DeleteChars procedure} -setup {
focus .e
} -body {
.e configure -textvariable contents -xscrollcommand scroll
+ set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
.e insert 0 abcde
.e delete 3 1000
- set timeout [after 500 {set $scrollInfo "timeout"}]
vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
@@ -2937,9 +2939,10 @@ test entry-16.4 {EntryVisibleRange procedure} -body {
test entry-17.1 {EntryUpdateScrollbar procedure} -body {
entry .e -width 10 -xscrollcommand scroll -font {Courier -12}
pack .e
+ update idletasks
+ set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
.e delete 0 end
.e insert 0 123
- set timeout [after 500 {set $scrollInfo "timeout"}]
vwait scrollInfo
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
@@ -2949,9 +2952,9 @@ test entry-17.1 {EntryUpdateScrollbar procedure} -body {
test entry-17.2 {EntryUpdateScrollbar procedure} -body {
entry .e -width 10 -xscrollcommand scroll -font {Courier -12}
pack .e
+ set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
.e insert 0 0123456789abcdef
.e xview 3
- set timeout [after 500 {set $scrollInfo "timeout"}]
vwait scrollInfo
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
@@ -2961,9 +2964,9 @@ test entry-17.2 {EntryUpdateScrollbar procedure} -body {
test entry-17.3 {EntryUpdateScrollbar procedure} -body {
entry .e -width 10 -xscrollcommand scroll -font {Courier -12}
pack .e
+ set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
.e insert 0 abcdefghijklmnopqrs
.e xview 6
- set timeout [after 500 {set $scrollInfo "timeout"}]
vwait scrollInfo
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
@@ -2976,8 +2979,10 @@ test entry-17.4 {EntryUpdateScrollbar procedure} -setup {
set x $msg
}
} -body {
- entry .e -width 5 -xscrollcommand thisisnotacommand
+ entry .e -width 5
pack .e
+ update idletasks
+ .e configure -xscrollcommand thisisnotacommand
vwait x
list $x $errorInfo
} -cleanup {
diff --git a/tests/listbox.test b/tests/listbox.test
index 01cc397..3a6c860 100644
--- a/tests/listbox.test
+++ b/tests/listbox.test
@@ -2662,41 +2662,37 @@ test listbox-21.8 {ListboxListVarProc, test selection after listvar mod} -setup
test listbox-21.9 {ListboxListVarProc, test hscrollbar after listvar mod} -setup {
destroy .l
} -body {
- catch {unset x}
+ set x {}
listbox .l -font $fixed -width 10 -xscrollcommand "record x" -listvar x
- set log {}
pack .l
- set timeout [after 500 {lappend log timeout1}]
- vwait log
+ update idletasks
+ set log {}
lappend x "0000000000"
- update
+ update idletasks
lappend x "00000000000000000000"
- update
+ update idletasks
set log
} -cleanup {
destroy .l
- after cancel $timeout
-} -result [list {x 0 1} {x 0 1} {x 0 0.5}]
+} -result [list {x 0 1} {x 0 0.5}]
test listbox-21.10 {ListboxListVarProc, test hscrollbar after listvar mod} -setup {
destroy .l
} -body {
catch {unset x}
listbox .l -font $fixed -width 10 -xscrollcommand "record x" -listvar x
- set log {}
pack .l
- set timeout [after 500 {lappend log timeout2}]
- vwait log
+ update idletasks
+ set log {}
lappend x "0000000000"
- update
+ update idletasks
lappend x "00000000000000000000"
- update
+ update idletasks
set x [list "0000000000"]
- update
+ update idletasks
set log
} -cleanup {
destroy .l
- after cancel $timeout
-} -result [list {x 0 1} {x 0 1} {x 0 0.5} {x 0 1}]
+} -result [list {x 0 1} {x 0 0.5} {x 0 1}]
test listbox-21.11 {ListboxListVarProc, bad list} -setup {
destroy .l
} -body {
diff --git a/tests/pack.test b/tests/pack.test
index b1c22c7..86fcad2 100644
--- a/tests/pack.test
+++ b/tests/pack.test
@@ -1549,6 +1549,14 @@ test pack-17.2 {PackLostSlaveProc procedure} -setup {
pack info .pack.a
} -returnCodes error -result {window ".pack.a" isn't packed}
+if {[tk windowingsystem] == "win32"} {
+ proc packUpdate {} {
+ update
+ }
+} else {
+ proc packUpdate {} {
+ }
+}
test pack-18.1 {unmap slaves when master unmapped} -constraints {
tempNotPc
@@ -1569,19 +1577,19 @@ test pack-18.1 {unmap slaves when master unmapped} -constraints {
eval destroy [winfo child .pack]
frame .pack.a -width 100 -height 50 -relief raised -bd 2
pack .pack.a
- update
+ update idletasks
set result [winfo ismapped .pack.a]
wm iconify .pack
- update
lappend result [winfo ismapped .pack.a]
.pack.a configure -width 200 -height 75
- update
+ update idletasks
lappend result [winfo width .pack.a ] [winfo height .pack.a] \
[winfo ismapped .pack.a]
wm deiconify .pack
- update
+ packUpdate
lappend result [winfo ismapped .pack.a]
} -result {1 0 200 75 0 1}
+
test pack-18.2 {unmap slaves when master unmapped} -setup {
eval destroy [winfo child .pack]
} -body {
@@ -1595,17 +1603,16 @@ test pack-18.2 {unmap slaves when master unmapped} -setup {
frame .pack.b -width 70 -height 30 -relief sunken -bd 2
pack .pack.a
pack .pack.b -in .pack.a
- update
+ update idletasks
set result [winfo ismapped .pack.b]
wm iconify .pack
- update
lappend result [winfo ismapped .pack.b]
.pack.b configure -width 100 -height 30
- update
+ update idletasks
lappend result [winfo width .pack.b ] [winfo height .pack.b] \
[winfo ismapped .pack.b]
wm deiconify .pack
- update
+ packUpdate
lappend result [winfo ismapped .pack.b]
} -result {1 0 100 30 0 1}
diff --git a/tests/place.test b/tests/place.test
index 62e0ed2..0a5e22f 100644
--- a/tests/place.test
+++ b/tests/place.test
@@ -258,40 +258,47 @@ test place-7.10 {ReconfigurePlacement procedure, computing size} -setup {
list [winfo width .t.f2] [winfo height .t.f2]
} -result {30 60}
+if {[tk windowingsystem] == "win32"} {
+ proc placeUpdate {} {
+ update
+ }
+} else {
+ proc placeUpdate {} {
+ }
+}
test place-8.1 {MasterStructureProc, mapping and unmapping slaves} -setup {
place forget .t.f2
place forget .t.f
} -body {
place .t.f2 -relx 1.0 -rely 1.0 -anchor sw
- update
+ update idletasks
set result [winfo ismapped .t.f2]
wm iconify .t
- update
lappend result [winfo ismapped .t.f2]
place .t.f2 -x 40 -y 30 -relx 0 -rely 0 -anchor nw
- update
+ update idletasks
lappend result [winfo x .t.f2] [winfo y .t.f2] [winfo ismapped .t.f2]
wm deiconify .t
- update
+ placeUpdate
lappend result [winfo ismapped .t.f2]
} -result {1 0 40 30 0 1}
test place-8.2 {MasterStructureProc, mapping and unmapping slaves} -setup {
place forget .t.f2
place forget .t.f
+ update idletasks
} -body {
place .t.f -x 0 -y 0 -width 200 -height 100
place .t.f2 -in .t.f -relx 1.0 -rely 1.0 -anchor sw -width 50 -height 20
- update
+ update idletasks
set result [winfo ismapped .t.f2]
wm iconify .t
- update
lappend result [winfo ismapped .t.f2]
place .t.f2 -x 40 -y 30 -relx 0 -rely 0 -anchor nw
- update
+ update idletasks
lappend result [winfo x .t.f2] [winfo y .t.f2] [winfo ismapped .t.f2]
wm deiconify .t
- update
+ placeUpdate
lappend result [winfo ismapped .t.f2]
} -result {1 0 42 32 0 1}
destroy .t
diff --git a/tests/spinbox.test b/tests/spinbox.test
index 5d79c8e..3f55d7f 100644
--- a/tests/spinbox.test
+++ b/tests/spinbox.test
@@ -12,6 +12,7 @@ eval tcltest::configure $argv
tcltest::loadTestedCommands
# For xscrollcommand
+set scrollInfo {}
proc scroll args {
global scrollInfo
set scrollInfo $args
@@ -2013,9 +2014,10 @@ test spinbox-5.7 {ConfigureSpinbox procedure} -setup {
} -body {
.e configure -font {Courier -12} -width 4 -xscrollcommand scroll
.e insert end "01234567890"
- set timeout [after 500 {set $scrollInfo "timeout"}]
- vwait scrollInfo
+ update idletasks
+ set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
.e configure -width 5
+ vwait scrollInfo
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
@@ -2204,8 +2206,9 @@ test spinbox-7.1 {InsertChars procedure} -setup {
} -body {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
+ update idletasks
+ set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
.e insert 2 XXX
- set timeout [after 500 {set $scrollInfo "timeout"}]
vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
@@ -2221,8 +2224,9 @@ test spinbox-7.2 {InsertChars procedure} -setup {
} -body {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
+ update idletasks
+ set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
.e insert 500 XXX
- set timeout [after 500 {set $scrollInfo "timeout"}]
vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
@@ -2355,8 +2359,9 @@ test spinbox-8.1 {DeleteChars procedure} -setup {
} -body {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
+ update idletasks
+ set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
.e delete 2 4
- set timeout [after 500 {set $scrollInfo "timeout"}]
vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
@@ -2371,8 +2376,9 @@ test spinbox-8.2 {DeleteChars procedure} -setup {
} -body {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
+ update idletasks
+ set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
.e delete -2 2
- set timeout [after 500 {set $scrollInfo "timeout"}]
vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
@@ -2387,8 +2393,9 @@ test spinbox-8.3 {DeleteChars procedure} -setup {
} -body {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
+ update idletasks
+ set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
.e delete 3 1000
- set timeout [after 500 {set $scrollInfo "timeout"}]
vwait scrollInfo
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
@@ -3173,9 +3180,10 @@ test spinbox-16.2 {SpinboxVisibleRange procedure} -body {
test spinbox-17.1 {SpinboxUpdateScrollbar procedure} -body {
spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12}
pack .e
+ update idletasks
+ set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
.e delete 0 end
.e insert 0 123
- set timeout [after 500 {set $scrollInfo "timeout"}]
vwait scrollInfo
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
@@ -3186,8 +3194,9 @@ test spinbox-17.2 {SpinboxUpdateScrollbar procedure} -body {
spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12}
pack .e
.e insert 0 0123456789abcdef
+ update idletasks
+ set timeout [after 500 {set $scrollInfo {-1000000 -1000000}}]
.e xview 3
- set timeout [after 500 {set $scrollInfo "timeout"}]
vwait scrollInfo
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
@@ -3197,23 +3206,26 @@ test spinbox-17.2 {SpinboxUpdateScrollbar procedure} -body {
test spinbox-17.3 {SpinboxUpdateScrollbar procedure} -body {
spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12}
pack .e
+ update idletasks
+ set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
.e insert 0 abcdefghijklmnopqrs
- .e xview 6
- set timeout [after 500 {set $scrollInfo "timeout"}]
+ .e xview
vwait scrollInfo
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
after cancel $timeout
-} -result {0.315789 0.842105}
+} -result {0.000000 0.526316}
test spinbox-17.4 {SpinboxUpdateScrollbar procedure} -setup {
proc bgerror msg {
global x
set x $msg
}
} -body {
- spinbox .e -width 5 -xscrollcommand thisisnotacommand
+ spinbox .e -width 5
pack .e
+ update idletasks
+ .e configure -xscrollcommand thisisnotacommand
vwait x
list $x $errorInfo
} -cleanup {
diff --git a/tests/textDisp.test b/tests/textDisp.test
index 796fd92..0881102 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -17,10 +17,20 @@ if {[tk windowingsystem] == "aqua"} {
proc updateText {} {
update idletasks
}
+ proc delay {} {
+ update idletasks
+ after 100
+ update idletasks
+ }
} else {
proc updateText {} {
update
}
+ proc delay {} {
+ update
+ after 100
+ update
+ }
}
# The procedure below is used as the scrolling command for the text;
@@ -3961,12 +3971,12 @@ test textDisp-31.3 {line update index shifting} {
.t insert 1.0 "abc\n"
.t insert 1.0 "abc\n"
lappend res [.t count -ypixels 1.0 end]
- update ; after 1000 ; update
+ delay
lappend res [.t count -ypixels 1.0 end]
.t.f configure -height 100
.t delete 1.0 3.0
lappend res [.t count -ypixels 1.0 end]
- update ; after 1000 ; update
+ delay
lappend res [.t count -ypixels 1.0 end]
set res
} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 8}] [expr {$fixedHeight * 9}] [expr {$fixedHeight * 7}] [expr {100 + $fixedHeight * 6}]]
@@ -4014,12 +4024,12 @@ test textDisp-31.6 {line update index shifting} {
.t insert 1.0 "abc\n"
.t insert 1.0 "abc\n"
lappend res [.t count -ypixels 1.0 end]
- update ; after 1000 ; update
+ delay
lappend res [.t count -ypixels 1.0 end]
textest configure -height 100
.t delete 1.0 3.0
lappend res [.t count -ypixels 1.0 end]
- update ; after 1000 ; update
+ delay
lappend res [.t count -ypixels 1.0 end]
set res
} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 8}] [expr {$fixedHeight * 9}] [expr {$fixedHeight * 7}] [expr {100 + $fixedHeight * 6}]]
@@ -4036,11 +4046,11 @@ test textDisp-31.7 {line update index shifting, elided} {
.t tag configure elide -elide 1
.t tag add elide 1.3 2.1
lappend res [.t count -ypixels 1.0 end]
- update ; after 1000 ; update
+ delay
lappend res [.t count -ypixels 1.0 end]
.t delete 1.0 3.0
lappend res [.t count -ypixels 1.0 end]
- update ; after 1000 ; update
+ delay
lappend res [.t count -ypixels 1.0 end]
set res
} [list [expr {$fixedHeight * 1}] [expr {$fixedHeight * 3}] [expr {$fixedHeight * 3}] [expr {$fixedHeight * 2}] [expr {$fixedHeight * 1}] [expr {$fixedHeight * 1}]]
@@ -4175,6 +4185,7 @@ test textDisp-32.3 "NULL undisplayProc problems: #1791052" -setup {
test textDisp-33.0 {one line longer than fits in the widget} {
pack [text .tt -wrap char]
+ updateText
.tt insert 1.0 [string repeat "more wrap + " 300]
updateText
.tt see 1.0
@@ -4183,6 +4194,7 @@ test textDisp-33.0 {one line longer than fits in the widget} {
test textDisp-33.1 {one line longer than fits in the widget} {
destroy .tt
pack [text .tt -wrap char]
+ updateText
.tt insert 1.0 [string repeat "more wrap + " 300]
updateText
.tt yview "1.0 +1 displaylines"
@@ -4196,12 +4208,12 @@ test textDisp-33.2 {one line longer than fits in the widget} {
destroy .tt
pack [text .tt -wrap char]
.tt debug 1
- update idletasks
+ updateText
set tk_textHeightCalc ""
- set timer [after 700 lappend tk_textHeightCalc "Timed out"]
+ set timer [after 200 lappend tk_textHeightCalc "Timed out"]
.tt insert 1.0 [string repeat "more wrap + " 1]
vwait tk_textHeightCalc
- after cancel timer
+ after cancel $timer
set tk_textHeightCalc
} {1.0}
test textDisp-33.3 {one line longer than fits in the widget} {
diff --git a/tests/ttk/spinbox.test b/tests/ttk/spinbox.test
index 40cb244..b86f053 100644
--- a/tests/ttk/spinbox.test
+++ b/tests/ttk/spinbox.test
@@ -204,16 +204,19 @@ test spinbox-3.0 "textarea should expand to fill widget" -setup {
set ::spinbox_test {}
ttk::spinbox .sb -from 0 -to 10 -textvariable SBV
} -body {
- grid .sb -sticky ew
grid columnconfigure . 0 -weight 1
+ update idletasks
+ set timer [after 500 {set ::spinbox_test timedout}]
bind . <Map> {
after idle {
wm geometry . "210x80"
- after 100 {set ::spinbox_test [.sb identify element 5 5]}
+ update idletasks
+ set ::spinbox_test [.sb identify element 25 5]
}
bind . <Map> {}
}
- after 500 {set ::spinbox_wait 1} ; vwait ::spinbox_wait
+ grid .sb -sticky ew
+ vwait ::spinbox_test
set ::spinbox_test
} -cleanup {
destroy .sb
diff --git a/tests/unixWm.test b/tests/unixWm.test
index b6efb42..39a68ae 100644
--- a/tests/unixWm.test
+++ b/tests/unixWm.test
@@ -19,16 +19,6 @@ proc sleep ms {
vwait x
}
-# The macOS window manager shows an animation when a window is deiconified.
-# Tests which check the geometry of a window after deiconifying it should
-# wait for the animation to finish.
-
- proc animationDelay {} {
- if {[tk windowingsystem] == "aqua"} {
- sleep 250
- }
- }
-
# Procedure to set up a collection of top-level windows
proc makeToplevels {} {
@@ -98,11 +88,11 @@ set i 1
foreach geom "+20+80 +80+$Y0 +0+$Y0 -0-0 +0-0 -0+$Y0 -10-5 -10+$Y5 +10-5" {
test unixWm-3.$i {moving window while iconified} unix {
wm iconify .t
- sleep 200
+ update idletasks
wm geom .t $geom
- update
+ update idletasks
wm deiconify .t
- animationDelay
+ update idletasks
scan [wm geom .t] %dx%d%1s%d%1s%d width height xsign x ysign y
format "%s%d%s%d" $xsign [eval expr $x$xsign$xerr] $ysign \
[eval expr $y$ysign$yerr]
@@ -114,11 +104,11 @@ set i 1
foreach geom "+20+80 +100+40 +0+$Y0" {
test unixWm-4.$i {moving window while withdrawn} unix {
wm withdraw .t
- sleep 200
+ update idletasks
wm geom .t $geom
- update
+ update idletasks
wm deiconify .t
- animationDelay
+ update idletasks
wm geom .t
} 100x150$geom
incr i
@@ -302,6 +292,7 @@ test unixWm-8.4 {icon windows} unix {
destroy .icon
toplevel .t -width 100 -height 30
wm geom .t +0+0
+ update idletasks
set result [wm iconwindow .t]
toplevel .icon -width 50 -height 50 -bg red
wm iconwindow .t .icon
@@ -311,7 +302,7 @@ test unixWm-8.4 {icon windows} unix {
update
lappend result [winfo ismapped .t] [winfo ismapped .icon]
wm iconify .t
- update
+ update idletasks
lappend result [winfo ismapped .t] [winfo ismapped .icon]
} {.icon icon {} withdrawn 1 0 0 0}
test unixWm-8.5 {icon windows} unix {
@@ -349,7 +340,6 @@ test unixWm-8.8 {icon windows} unix {
wm geom .t +0+0
tkwait visibility .t ;# Needed to keep tvtwm happy.
wm iconwindow .t .icon
- sleep 500
lappend result [winfo ismapped .t] [winfo ismapped .icon]
} {1 1 0}
test unixWm-8.9 {icon windows} {unix nonPortable} {
@@ -421,12 +411,10 @@ test unixWm-9.3 {TkWmMapWindow procedure, iconic windows} unix {
toplevel .t -width 100 -height 300 -bg blue
wm geom .t +0+0
wm iconify .t
- sleep 500
winfo ismapped .t
} {0}
test unixWm-9.4 {TkWmMapWindow procedure, icon windows} unix {
destroy .t
- sleep 500
toplevel .t -width 100 -height 50 -bg blue
tkwait visibility .t
wm iconwindow . .t
@@ -867,9 +855,9 @@ test unixWm-23.5 {Tk_WmCmd procedure, "iconify" option} unix {
destroy .t2
toplevel .t2
wm geom .t2 +0+0
- update
+ update idletasks
wm iconify .t2
- update
+ update idletasks
set result [winfo ismapped .t2]
destroy .t2
set result
@@ -878,10 +866,10 @@ test unixWm-23.6 {Tk_WmCmd procedure, "iconify" option} unix {
destroy .t2
toplevel .t2
wm geom .t2 -0+0
- update
+ update idletasks
set result [winfo ismapped .t2]
wm iconify .t2
- update
+ update idletasks
lappend result [winfo ismapped .t2]
destroy .t2
set result
@@ -1385,12 +1373,13 @@ test unixWm-40.2 {Tk_SetGrid procedure, turning on grid when dimensions already
test unixWm-41.1 {ConfigureEvent procedure, internally generated size changes} unix {
destroy .t
toplevel .t -width 400 -height 150
- wm geometry .t +0+0
tkwait visibility .t
+ wm geometry .t +0+0
+ update idletasks
set result {}
lappend result [winfo width .t] [winfo height .t]
.t configure -width 200 -height 300
- sleep 500
+ update idletasks
lappend result [winfo width .t] [winfo height .t]
} {400 150 200 300}
test unixWm-41.2 {ConfigureEvent procedure, menubars} {nonPortable testmenubar} {
@@ -1454,11 +1443,11 @@ test unixWm-42.1 {WrapperEventProc procedure, map and unmap events} unix {
bind .t <Unmap> {set x "unmapped"}
set x {no event}
wm iconify .t
- animationDelay
+ update idletasks
lappend result $x [winfo ismapped .t]
set x {no event}
wm deiconify .t
- animationDelay
+ update idletasks
lappend result $x [winfo ismapped .t]
} {unmapped 0 mapped 1}
@@ -1971,7 +1960,6 @@ test unixWm-50.8 {Tk_CoordsToWindow procedure, more basics} unix {
test unixWm-50.9 {Tk_CoordsToWindow procedure, unmapped windows} unix {
destroy .t
destroy .t2
- sleep 500 ;# Give window manager time to catch up.
toplevel .t -width 200 -height 200 -bg green
wm geometry .t +0+0
tkwait visibility .t
@@ -1980,7 +1968,7 @@ test unixWm-50.9 {Tk_CoordsToWindow procedure, unmapped windows} unix {
tkwait visibility .t2
set result [list [winfo containing 100 100]]
wm iconify .t2
- animationDelay
+ update idletasks
lappend result [winfo containing 100 100]
} {.t2 .t}
test unixWm-50.10 {Tk_CoordsToWindow procedure, unmapped windows} unix {
@@ -1990,9 +1978,10 @@ test unixWm-50.10 {Tk_CoordsToWindow procedure, unmapped windows} unix {
frame .t.f -width 150 -height 150 -bd 2 -relief raised
place .t.f -x 25 -y 25
tkwait visibility .t.f
+ update idletasks
set result [list [winfo containing 100 100]]
place forget .t.f
- update
+ update idletasks
lappend result [winfo containing 100 100]
} {.t.f .t}
deleteWindows
@@ -2022,7 +2011,6 @@ test unixWm-51.3 {TkWmRestackToplevel procedure, basic tests} {unix nonPortable}
set result [winfo containing [winfo rootx .raise1] \
[winfo rooty .raise1]]
destroy .raise2
- sleep 500
list $result [winfo containing [winfo rootx .raise1] \
[winfo rooty .raise1]]
} {.raise2 .raise1}
@@ -2033,7 +2021,6 @@ test unixWm-51.4 {TkWmRestackToplevel procedure, basic tests} {unix nonPortable}
lower .raise3 .raise1
set result [winfo containing 100 100]
destroy .raise1
- sleep 500
lappend result [winfo containing 100 100]
} {.raise1 .raise3}
test unixWm-51.5 {TkWmRestackToplevel procedure, basic tests} {unix nonPortable} {
@@ -2048,7 +2035,6 @@ test unixWm-51.5 {TkWmRestackToplevel procedure, basic tests} {unix nonPortable}
set result [winfo containing [winfo rootx .raise1] \
[winfo rooty .raise1]]
destroy .raise1
- sleep 500
list $result [winfo containing [winfo rootx .raise2] \
[winfo rooty .raise2]]
} {.raise1 .raise3}
@@ -2071,11 +2057,9 @@ test unixWm-51.7 {TkWmRestackToplevel procedure, other window isn't mapped} unix
wm geometry $w +0+0
}
raise .t .t2
- sleep 2000
update
set result [list [winfo containing 100 100]]
lower .t3
- sleep 2000
lappend result [winfo containing 100 100]
} {.t3 .t}
test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix {
diff --git a/tests/wm.test b/tests/wm.test
index 9e6d8ce..fac02fe 100644
--- a/tests/wm.test
+++ b/tests/wm.test
@@ -33,7 +33,9 @@ proc stdWindow {} {
#
proc raiseDelay {} {
- after 100; update
+ after 100;
+ update
+ update idletasks
}
# How to carry out a small delay while processing events
@@ -808,10 +810,10 @@ test wm-iconify-2.4.2 {Misc errors} -constraints !win -setup {
test wm-iconify-3.1 {iconify behavior} -body {
toplevel .t2
wm geom .t2 -0+0
- update
+ update idletasks
set result [winfo ismapped .t2]
wm iconify .t2
- update
+ update idletasks
lappend result [winfo ismapped .t2]
} -cleanup {
destroy .t2
@@ -1738,11 +1740,11 @@ test wm-transient-4.2 {already mapped transient toplevel
toplevel .master
raiseDelay
wm iconify .master
- update
+ update idletasks
toplevel .subject
- update
+ update idletasks
wm transient .subject .master
- update
+ update idletasks
list [wm state .subject] [winfo ismapped .subject]
} -cleanup {
deleteWindows
@@ -1753,13 +1755,13 @@ test wm-transient-4.3 {iconify/deiconify on the master
} -body {
toplevel .master
toplevel .subject
- update
+ update idletasks
wm transient .subject .master
wm iconify .master
- update
+ update idletasks
lappend results [wm state .subject] [winfo ismapped .subject]
wm deiconify .master
- update
+ update idletasks
lappend results [wm state .subject] [winfo ismapped .subject]
} -cleanup {
deleteWindows