The master and develop branches track hengband.
OS X development happens on the macos-1-6-2, macos-2-2-1, and macos-develop branches.
Revision | 6d7e9c29f7c7efc2e12eac25557657793dd6e42a (tree) |
---|---|
Time | 2020-02-17 14:03:02 |
Author | Eric Branlund <ebranlund@fast...> |
Commiter | Eric Branlund |
Fixed regression: minimum window size not correctly set at startup on main window.
@@ -466,8 +466,13 @@ static int resize_pending_changes(struct PendingChanges* pc, int nrow) | ||
466 | 466 | * defaults */ |
467 | 467 | - (void)resizeTerminalWithContentRect: (NSRect)contentRect saveToDefaults: (BOOL)saveToDefaults; |
468 | 468 | |
469 | -/* Change the minimum size for the window associated with the context. */ | |
470 | -- (void)setMinimumWindowSize; | |
469 | +/* | |
470 | + * Change the minimum size for the window associated with the context. | |
471 | + * If termIdx is not negative, use it as the terminal index (that is useful | |
472 | + * if self->terminal has not been set yet). Otherwise, [self terminalIndex] | |
473 | + * will be used as the index. | |
474 | + */ | |
475 | +- (void)setMinimumWindowSize:(int)termIdx; | |
471 | 476 | |
472 | 477 | /* Called from the view to indicate that it is starting or ending live resize */ |
473 | 478 | - (void)viewWillStartLiveResize:(AngbandView *)view; |
@@ -1091,7 +1096,7 @@ static int compare_advances(const void *ap, const void *bp) | ||
1091 | 1096 | * and rows since they could be changed */ |
1092 | 1097 | NSRect contentRect = [self->primaryWindow contentRectForFrameRect: [self->primaryWindow frame]]; |
1093 | 1098 | |
1094 | - [self setMinimumWindowSize]; | |
1099 | + [self setMinimumWindowSize:-1]; | |
1095 | 1100 | NSSize size = self->primaryWindow.contentMinSize; |
1096 | 1101 | BOOL windowNeedsResizing = NO; |
1097 | 1102 | if (contentRect.size.width < size.width) { |
@@ -1677,11 +1682,14 @@ static NSMenuItem *superitem(NSMenuItem *self) | ||
1677 | 1682 | Term_activate( old ); |
1678 | 1683 | } |
1679 | 1684 | |
1680 | -- (void)setMinimumWindowSize | |
1685 | +- (void)setMinimumWindowSize:(int)termIdx | |
1681 | 1686 | { |
1682 | 1687 | NSSize minsize; |
1683 | 1688 | |
1684 | - if ([self terminalIndex] == 0) { | |
1689 | + if (termIdx < 0) { | |
1690 | + termIdx = [self terminalIndex]; | |
1691 | + } | |
1692 | + if (termIdx == 0) { | |
1685 | 1693 | minsize.width = 80; |
1686 | 1694 | minsize.height = 24; |
1687 | 1695 | } else { |
@@ -2031,8 +2039,8 @@ static void Term_init_cocoa(term *t) | ||
2031 | 2039 | #endif |
2032 | 2040 | ]; |
2033 | 2041 | [window setTitle:title]; |
2034 | - [context setMinimumWindowSize]; | |
2035 | - | |
2042 | + [context setMinimumWindowSize:termIdx]; | |
2043 | + | |
2036 | 2044 | /* If this is the first term, and we support full screen (Mac OS X Lion or |
2037 | 2045 | * later), then allow it to go full screen (sweet). Allow other terms to be |
2038 | 2046 | * FullScreenAuxilliary, so they can at least show up. Unfortunately in |