aboutsummaryrefslogtreecommitdiffstats
path: root/src/nsterm.m
diff options
context:
space:
mode:
Diffstat (limited to 'src/nsterm.m')
-rw-r--r--src/nsterm.m31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index bf83550b3d7..36d906a7cec 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1570,6 +1570,7 @@ x_make_frame_visible (struct frame *f)
1570 if (!FRAME_VISIBLE_P (f)) 1570 if (!FRAME_VISIBLE_P (f))
1571 { 1571 {
1572 EmacsView *view = (EmacsView *)FRAME_NS_VIEW (f); 1572 EmacsView *view = (EmacsView *)FRAME_NS_VIEW (f);
1573 NSWindow *window = [view window];
1573 1574
1574 SET_FRAME_VISIBLE (f, 1); 1575 SET_FRAME_VISIBLE (f, 1);
1575 ns_raise_frame (f, ! FRAME_NO_FOCUS_ON_MAP (f)); 1576 ns_raise_frame (f, ! FRAME_NO_FOCUS_ON_MAP (f));
@@ -1586,6 +1587,23 @@ x_make_frame_visible (struct frame *f)
1586 [view handleFS]; 1587 [view handleFS];
1587 unblock_input (); 1588 unblock_input ();
1588 } 1589 }
1590
1591 /* Making a frame invisible seems to break the parent->child
1592 relationship, so reinstate it. */
1593 if ([window parentWindow] == nil && FRAME_PARENT_FRAME (f) != NULL)
1594 {
1595 NSWindow *parent = [FRAME_NS_VIEW (FRAME_PARENT_FRAME (f)) window];
1596
1597 block_input ();
1598 [parent addChildWindow: window
1599 ordered: NSWindowAbove];
1600 unblock_input ();
1601
1602 /* If the parent frame moved while the child frame was
1603 invisible, the child frame's position won't have been
1604 updated. Make sure it's in the right place now. */
1605 x_set_offset(f, f->left_pos, f->top_pos, 0);
1606 }
1589 } 1607 }
1590} 1608}
1591 1609
@@ -5479,6 +5497,19 @@ ns_term_shutdown (int sig)
5479 object:nil]; 5497 object:nil];
5480#endif 5498#endif
5481 5499
5500#ifdef NS_IMPL_COCOA
5501 if ([NSApp activationPolicy] == NSApplicationActivationPolicyProhibited) {
5502 /* Set the app's activation policy to regular when we run outside
5503 of a bundle. This is already done for us by Info.plist when we
5504 run inside a bundle. */
5505 [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
5506 [NSApp setApplicationIconImage:
5507 [EmacsImage
5508 allocInitFromFile:
5509 build_string("icons/hicolor/128x128/apps/emacs.png")]];
5510 }
5511#endif
5512
5482 ns_send_appdefined (-2); 5513 ns_send_appdefined (-2);
5483} 5514}
5484 5515