diff options
author | culler <culler> | 2018-11-03 21:48:37 (GMT) |
---|---|---|
committer | culler <culler> | 2018-11-03 21:48:37 (GMT) |
commit | 47fe871919f31cfa710821c3bfc9525f22fff775 (patch) | |
tree | 8f5243ec773481c7a2c04fe517f1def08e4fe682 /macosx | |
parent | 7ecb35e70563f3673d088c5df201b86b4974dd97 (diff) | |
download | tk-47fe871919f31cfa710821c3bfc9525f22fff775.zip tk-47fe871919f31cfa710821c3bfc9525f22fff775.tar.gz tk-47fe871919f31cfa710821c3bfc9525f22fff775.tar.bz2 |
On 10.13 we must now process idle events in drawRect, as in 10.14, but we also
must lock focus inside the s[NSView setFrame] method.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXWindowEvent.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 8d04564..d367506 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -915,9 +915,19 @@ ConfigureRestrictProc( HIRect bounds = NSRectToCGRect([self bounds]); HIShapeRef shape = HIShapeCreateWithRect(&bounds); + Bool locked = false; + /* + * On OSX versions below 10.14 we *must* lock focus to enable drawing. + * As of 10.14 this is unnecessary and lockFocusIfCanDraw is deprecated. + */ + if (self != [NSView focusView]) { + locked = [self lockFocusIfCanDraw]; + } [self generateExposeEvents: shape]; [w displayIfNeeded]; - [NSApp _unlockAutoreleasePool]; + if (locked) { + [self unlockFocus]; + } [NSApp setIsDrawing:NO]; } } @@ -977,9 +987,7 @@ ConfigureRestrictProc( * were created when the expose events were processed. Unfortunately * this does not work in macOS 10.13. */ - if ([NSApp macMinorVersion] > 13 || [self inLiveResize]) { - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {} - } + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {} } } |