• R/O
  • HTTP
  • SSH
  • HTTPS

hengbandosx: Commit

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.


Commit MetaInfo

Revision6d7e9c29f7c7efc2e12eac25557657793dd6e42a (tree)
Time2020-02-17 14:03:02
AuthorEric Branlund <ebranlund@fast...>
CommiterEric Branlund

Log Message

Fixed regression: minimum window size not correctly set at startup on main window.

Change Summary

Incremental Difference

--- a/src/main-cocoa.m
+++ b/src/main-cocoa.m
@@ -466,8 +466,13 @@ static int resize_pending_changes(struct PendingChanges* pc, int nrow)
466466 * defaults */
467467 - (void)resizeTerminalWithContentRect: (NSRect)contentRect saveToDefaults: (BOOL)saveToDefaults;
468468
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;
471476
472477 /* Called from the view to indicate that it is starting or ending live resize */
473478 - (void)viewWillStartLiveResize:(AngbandView *)view;
@@ -1091,7 +1096,7 @@ static int compare_advances(const void *ap, const void *bp)
10911096 * and rows since they could be changed */
10921097 NSRect contentRect = [self->primaryWindow contentRectForFrameRect: [self->primaryWindow frame]];
10931098
1094- [self setMinimumWindowSize];
1099+ [self setMinimumWindowSize:-1];
10951100 NSSize size = self->primaryWindow.contentMinSize;
10961101 BOOL windowNeedsResizing = NO;
10971102 if (contentRect.size.width < size.width) {
@@ -1677,11 +1682,14 @@ static NSMenuItem *superitem(NSMenuItem *self)
16771682 Term_activate( old );
16781683 }
16791684
1680-- (void)setMinimumWindowSize
1685+- (void)setMinimumWindowSize:(int)termIdx
16811686 {
16821687 NSSize minsize;
16831688
1684- if ([self terminalIndex] == 0) {
1689+ if (termIdx < 0) {
1690+ termIdx = [self terminalIndex];
1691+ }
1692+ if (termIdx == 0) {
16851693 minsize.width = 80;
16861694 minsize.height = 24;
16871695 } else {
@@ -2031,8 +2039,8 @@ static void Term_init_cocoa(term *t)
20312039 #endif
20322040 ];
20332041 [window setTitle:title];
2034- [context setMinimumWindowSize];
2035-
2042+ [context setMinimumWindowSize:termIdx];
2043+
20362044 /* If this is the first term, and we support full screen (Mac OS X Lion or
20372045 * later), then allow it to go full screen (sweet). Allow other terms to be
20382046 * FullScreenAuxilliary, so they can at least show up. Unfortunately in
Show on old repository browser