summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--macosx/tkMacOSXInit.c9
-rw-r--r--macosx/tkMacOSXWindowEvent.c10
-rw-r--r--macosx/tkMacOSXWm.c2
3 files changed, 14 insertions, 7 deletions
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index cb97f47..26eb3f5 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -72,11 +72,13 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt
_mainPool = [NSAutoreleasePool new];
}
}
+
#ifdef TK_MAC_DEBUG_NOTIFICATIONS
- (void)_postedNotification:(NSNotification *)notification {
TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
}
#endif
+
- (void)_setupApplicationNotifications {
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
#define observe(n, s) [nc addObserver:self selector:@selector(s) name:(n) object:nil]
@@ -91,18 +93,19 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt
CFNotificationCenterAddObserver(CFNotificationCenterGetDistributedCenter(), NULL, &keyboardChanged, kTISNotifySelectedKeyboardInputSourceChanged, NULL, CFNotificationSuspensionBehaviorCoalesce);
#endif
}
+
- (void)_setupEventLoop {
NSAutoreleasePool *pool = [NSAutoreleasePool new];
[self finishLaunching];
[self setWindowsNeedUpdate:YES];
[pool drain];
}
+
- (void)_setup:(Tcl_Interp *)interp {
_eventInterp = interp;
- _mainPool = nil;
+ _mainPool = [NSAutoreleasePool new];
[NSApp setPoolProtected:NO];
_defaultMainMenu = nil;
- NSAutoreleasePool *pool = [NSAutoreleasePool new];
[self _setupMenus];
[self setDelegate:self];
#ifdef TK_MAC_DEBUG_NOTIFICATIONS
@@ -111,8 +114,8 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt
#endif
[self _setupWindowNotifications];
[self _setupApplicationNotifications];
- [pool drain];
}
+
- (NSString *)tkFrameworkImagePath:(NSString*)image {
NSString *path = nil;
NSAutoreleasePool *pool = [NSAutoreleasePool new];
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index 91cc348..fce3801 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];
+ }
}
/*
@@ -862,12 +866,9 @@ ConfigureRestrictProc(
/*
* Try to prevent flickers and flashes.
- *
- * This stops the flickers, but on OSX 10.11 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);
@@ -891,6 +892,7 @@ ConfigureRestrictProc(
while (Tk_DoOneEvent(TK_ALL_EVENTS|TK_DONT_WAIT)) {}
[w enableFlushWindow];
[w flushWindowIfNeeded];
+ NSEnableScreenUpdates();
[NSApp setPoolProtected:NO];
}
}
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 50cac20..5df72f0 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -907,6 +907,8 @@ TkWmDeadWindow(
[front makeKeyAndOrderFront:NSApp];
}
}
+ [NSApp _resetAutoreleasePool];
+
#if DEBUG_ZOMBIES > 0
fprintf(stderr, "================= Pool dump ===================\n");
[NSAutoreleasePool showPools];