summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorculler <culler>2020-06-06 21:20:19 (GMT)
committerculler <culler>2020-06-06 21:20:19 (GMT)
commit94df92d713ad84ae1e93183be6a9927209783795 (patch)
treee0ec0eced479e94cd3503f8cf11c06abe9cd27e7 /macosx
parentbcf017e94b644b427d704da23be4bbe164978fff (diff)
downloadtk-94df92d713ad84ae1e93183be6a9927209783795.zip
tk-94df92d713ad84ae1e93183be6a9927209783795.tar.gz
tk-94df92d713ad84ae1e93183be6a9927209783795.tar.bz2
More attempts to make sure new windows are complete.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXWindowEvent.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index debe5b8..07965f0 100644
--- a/macosx/tkMacOSXWindowEvent.c
+++ b/macosx/tkMacOSXWindowEvent.c
@@ -39,9 +39,9 @@ static void DoWindowActivate(ClientData clientData);
#pragma mark TKApplication(TKWindowEvent)
extern NSString *NSWindowDidOrderOnScreenNotification;
+extern NSString *NSWindowWillOrderOnScreenNotification;
#ifdef TK_MAC_DEBUG_NOTIFICATIONS
-extern NSString *NSWindowWillOrderOnScreenNotification;
extern NSString *NSWindowDidOrderOffScreenNotification;
#endif
@@ -218,6 +218,15 @@ extern NSString *NSWindowDidOrderOffScreenNotification;
[view addTkDirtyRect:[view bounds]];
Tcl_CancelIdleCall(TkMacOSXDrawAllViews, NULL);
Tcl_DoWhenIdle(TkMacOSXDrawAllViews, NULL);
+ }
+}
+
+- (void) windowMapped: (NSNotification *) notification
+{
+ NSWindow *w = [notification object];
+ TkWindow *winPtr = TkMacOSXGetTkWindow(w);
+
+ if (winPtr) {
while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {}
}
}
@@ -235,18 +244,6 @@ extern NSString *NSWindowDidOrderOffScreenNotification;
//BOOL start = [[notification name] isEqualToString:NSWindowWillStartLiveResizeNotification];
}
-- (void) windowMapped: (NSNotification *) notification
-{
- TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
- NSWindow *w = [notification object];
- TkWindow *winPtr = TkMacOSXGetTkWindow(w);
-
- printf("windowMapped\n");
- if (winPtr) {
- //Tk_MapWindow((Tk_Window) winPtr);
- }
-}
-
- (void) windowUnmapped: (NSNotification *) notification
{
TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
@@ -274,6 +271,8 @@ extern NSString *NSWindowDidOrderOffScreenNotification;
observe(NSWindowDidDeminiaturizeNotification, windowExpanded:);
observe(NSWindowDidMiniaturizeNotification, windowCollapsed:);
observe(NSWindowDidOrderOnScreenNotification, windowBecameVisible:);
+ observe(NSWindowWillOrderOnScreenNotification, windowMapped:);
+ observe(NSWindowDidOrderOnScreenNotification, windowBecameVisible:);
#if !(MAC_OS_X_VERSION_MAX_ALLOWED < 1070)
observe(NSWindowDidEnterFullScreenNotification, windowEnteredFullScreen:);
@@ -284,8 +283,6 @@ extern NSString *NSWindowDidOrderOffScreenNotification;
observe(NSWindowWillMoveNotification, windowDragStart:);
observe(NSWindowWillStartLiveResizeNotification, windowLiveResize:);
observe(NSWindowDidEndLiveResizeNotification, windowLiveResize:);
- observe(NSWindowWillOrderOnScreenNotification, windowMapped:);
- observe(NSWindowDidOrderOnScreenNotification, windowBecameVisible:);
observe(NSWindowDidOrderOffScreenNotification, windowUnmapped:);
#endif
#undef observe