summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXSubwindows.c
diff options
context:
space:
mode:
authormarc_culler <marc.culler@gmail.com>2020-09-09 19:25:22 (GMT)
committermarc_culler <marc.culler@gmail.com>2020-09-09 19:25:22 (GMT)
commit22e941ecb6c39df473fa3ed938bdaeb0784aff76 (patch)
tree3dc6aad5318db4c0ef8251851ac29fa1291092be /macosx/tkMacOSXSubwindows.c
parentc0cbf2de196d27643e7267a53c37d4bf4810ffef (diff)
downloadtk-22e941ecb6c39df473fa3ed938bdaeb0784aff76.zip
tk-22e941ecb6c39df473fa3ed938bdaeb0784aff76.tar.gz
tk-22e941ecb6c39df473fa3ed938bdaeb0784aff76.tar.bz2
Fix [ab1feaea9c]: Aqua initialization issues exposed by Scid vs Mac.
Diffstat (limited to 'macosx/tkMacOSXSubwindows.c')
-rw-r--r--macosx/tkMacOSXSubwindows.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c
index 002eae6..682fbb3 100644
--- a/macosx/tkMacOSXSubwindows.c
+++ b/macosx/tkMacOSXSubwindows.c
@@ -143,6 +143,7 @@ XMapWindow(
TkWindow *winPtr = macWin->winPtr;
NSWindow *win = TkMacOSXGetNSWindowForDrawable(window);
XEvent event;
+ static Bool initialized = NO;
/*
* Under certain situations it's possible for this function to be called
@@ -172,12 +173,14 @@ XMapWindow(
TkMacOSXApplyWindowAttributes(winPtr, win);
[win setExcludedFromWindowsMenu:NO];
- [NSApp activateIgnoringOtherApps:NO];
+ [NSApp activateIgnoringOtherApps:initialized];
[view addTkDirtyRect: [view bounds]];
- if ([win canBecomeKeyWindow]) {
- [win makeKeyAndOrderFront:NSApp];
- } else {
- [win orderFrontRegardless];
+ if (initialized) {
+ if ([win canBecomeKeyWindow]) {
+ [win makeKeyAndOrderFront:NSApp];
+ } else {
+ [win orderFrontRegardless];
+ }
}
} else {
TkWindow *contWinPtr = TkpGetOtherWindow(winPtr);
@@ -233,11 +236,15 @@ XMapWindow(
* Generate VisibilityNotify events for window and all mapped children.
*/
- event.xany.send_event = False;
- event.xany.display = display;
- event.xvisibility.type = VisibilityNotify;
- event.xvisibility.state = VisibilityUnobscured;
- NotifyVisibility(winPtr, &event);
+ if (initialized) {
+ event.xany.send_event = False;
+ event.xany.display = display;
+ event.xvisibility.type = VisibilityNotify;
+ event.xvisibility.state = VisibilityUnobscured;
+ NotifyVisibility(winPtr, &event);
+ } else {
+ initialized = YES;
+ }
return Success;
}