diff options
author | culler <culler> | 2018-11-15 17:09:15 (GMT) |
---|---|---|
committer | culler <culler> | 2018-11-15 17:09:15 (GMT) |
commit | da66d37ceb937a37d127756a86d8ee52abbbd398 (patch) | |
tree | 4fa17449e329da7927974cb12a5df6dffc96da71 /macosx | |
parent | 00f20fd81a83e661ed54055ab50cbfbf2ab10fd3 (diff) | |
parent | 13080bd706087870892fd7275ef8df1693e26626 (diff) | |
download | tk-da66d37ceb937a37d127756a86d8ee52abbbd398.zip tk-da66d37ceb937a37d127756a86d8ee52abbbd398.tar.gz tk-da66d37ceb937a37d127756a86d8ee52abbbd398.tar.bz2 |
Use a better method for making test images on the mac emulate test images on other platforms.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXDraw.c | 8 | ||||
-rw-r--r-- | macosx/tkMacOSXEvent.c | 5 | ||||
-rw-r--r-- | macosx/tkMacOSXInit.c | 5 | ||||
-rw-r--r-- | macosx/tkMacOSXInt.h | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXPrivate.h | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXTest.c | 20 | ||||
-rw-r--r-- | macosx/tkMacOSXWindowEvent.c | 4 |
7 files changed, 13 insertions, 33 deletions
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 984e2e5..faad137 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -1496,14 +1496,6 @@ TkMacOSXSetupDrawingContext( CGRect clipBounds; /* - * If we are simulating drawing for tests, just return false. - */ - - if ([NSApp simulateDrawing]) { - return false; - } - - /* * If the drawable is not a pixmap and it has an associated * NSWindow then we know we are drawing to a window. */ diff --git a/macosx/tkMacOSXEvent.c b/macosx/tkMacOSXEvent.c index 798c73c..c03a6fb 100644 --- a/macosx/tkMacOSXEvent.c +++ b/macosx/tkMacOSXEvent.c @@ -137,10 +137,7 @@ MODULE_SCOPE void TkMacOSXFlushWindows(void) { NSArray *macWindows = [NSApp orderedWindows]; - if ([NSApp simulateDrawing]) { - [NSApp setSimulateDrawing:NO]; - return; - } + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)){} for (NSWindow *w in macWindows) { if (TkMacOSXGetXWindow(w)) { [w displayIfNeeded]; diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index 8e9c600..3a212c4 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -47,7 +47,6 @@ static char scriptPath[PATH_MAX + 1] = ""; @synthesize poolLock = _poolLock; @synthesize macMinorVersion = _macMinorVersion; @synthesize isDrawing = _isDrawing; -@synthesize simulateDrawing = _simulateDrawing; @end /* @@ -166,15 +165,15 @@ static char scriptPath[PATH_MAX + 1] = ""; [NSApp setMacMinorVersion: minorVersion]; /* - * We are not drawing yet. + * We are not drawing right now. */ [NSApp setIsDrawing:NO]; - [NSApp setSimulateDrawing:NO]; /* * Be our own delegate. */ + [self setDelegate:self]; /* diff --git a/macosx/tkMacOSXInt.h b/macosx/tkMacOSXInt.h index 4e1e689..d942286 100644 --- a/macosx/tkMacOSXInt.h +++ b/macosx/tkMacOSXInt.h @@ -200,7 +200,7 @@ MODULE_SCOPE void TkpReleaseRegion(TkRegion r); MODULE_SCOPE void TkpShiftButton(NSButton *button, NSPoint delta); MODULE_SCOPE Bool TkpAppIsDrawing(void); MODULE_SCOPE void TkpDisplayWindow(Tk_Window tkwin); -MODULE_SCOPE void TkTestSimulateDrawing(Bool); +MODULE_SCOPE Bool TkTestAppIsDrawing(void); /* * Include the stubbed internal platform-specific API. diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index d804ca0..f3228c4 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -265,13 +265,11 @@ VISIBILITY_HIDDEN int _poolLock; int _macMinorVersion; Bool _isDrawing; - Bool _simulateDrawing; #endif } @property int poolLock; @property int macMinorVersion; @property Bool isDrawing; -@property Bool simulateDrawing; @end @interface TKApplication(TKInit) diff --git a/macosx/tkMacOSXTest.c b/macosx/tkMacOSXTest.c index 5576c44..b7923b0 100644 --- a/macosx/tkMacOSXTest.c +++ b/macosx/tkMacOSXTest.c @@ -82,30 +82,28 @@ DebuggerObjCmd( /* *---------------------------------------------------------------------- * - * TkTestSimulateDrawing -- + * TkTestAppIsDrawing -- * * A test widget display procedure which records calls can use this to - * avoid duplicate calls which would occur due to fact that no valid - * graphics context is available to the idle task which is running the - * display proc. Note that no actual drawing to the screen will take - * place when this flag is set. This is just a wrapper for the NSApp + * detect whether it is being called from within [NSView drawRect]. + * If so, it probably should not be recording the call since it was + * probably generated spontaneously by the window manager rather than + * by an explicit call to update. This is just a wrapper for the NSApp * property. * * * Results: - * Calls to low level drawing routines will return without actually - * drawing anything to the screen. + * Returns true if and only if called from within [NSView drawRect]. * * Side effects: * None * *---------------------------------------------------------------------- */ -MODULE_SCOPE void -TkTestSimulateDrawing(Bool yesno) { - [NSApp setSimulateDrawing:yesno]; +MODULE_SCOPE Bool +TkTestAppIsDrawing(void) { + return [NSApp isDrawing]; } - /* diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index a1a3d1a..4532b0c 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -832,10 +832,6 @@ ConfigureRestrictProc( Tk_PathName(winPtr)); #endif - if ([NSApp simulateDrawing]) { - return; - } - /* * We do not allow recursive calls to drawRect, but we only log * them on OSX > 10.13, where they should never happen. |