diff options
author | Kevin Walzer <kw@codebykevin.com> | 2016-01-09 02:58:47 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2016-01-09 02:58:47 (GMT) |
commit | 3e525786724c39e02e20eda8c5684ce7c0ec7e00 (patch) | |
tree | 0472f8d999250af4e11717652402caac105a3493 /macosx/tkMacOSXWindowEvent.c | |
parent | 43554959e209cc2aaf81dbbb6909cf9d77cf57f4 (diff) | |
download | tk-3e525786724c39e02e20eda8c5684ce7c0ec7e00.zip tk-3e525786724c39e02e20eda8c5684ce7c0ec7e00.tar.gz tk-3e525786724c39e02e20eda8c5684ce7c0ec7e00.tar.bz2 |
Additional fixes for memory leaks, window flickering on OS X 10.11; thanks to Marc Culler for patch
Diffstat (limited to 'macosx/tkMacOSXWindowEvent.c')
-rw-r--r-- | macosx/tkMacOSXWindowEvent.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 95ebb25..461a94c 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -165,6 +165,10 @@ extern BOOL opaqueTag; if (winPtr) { TkGenWMDestroyEvent((Tk_Window) winPtr); + if (_windowWithMouse == w) { + _windowWithMouse = nil; + [w release]; + } } /* @@ -858,12 +862,9 @@ ConfigureRestrictProc( /* * Try to prevent flickers and flashes. - * - * This stops the flickers on OSX 10.11. But flashes still occur when - * the width of the window is 16, 32, 48, 64, 80, 96, 112, 256, 512, - * 768, ... :^( */ [w disableFlushWindow]; + NSDisableScreenUpdates(); /* Disable Tk drawing until the window has been completely configured.*/ TkMacOSXSetDrawingEnabled(winPtr, 0); @@ -887,6 +888,7 @@ ConfigureRestrictProc( while (Tk_DoOneEvent(TK_ALL_EVENTS|TK_DONT_WAIT)) {} [w enableFlushWindow]; [w flushWindowIfNeeded]; + NSEnableScreenUpdates(); [NSApp setPoolProtected:NO]; } } |