• R/O
  • HTTP
  • SSH
  • HTTPS

hengbandosx: Commit


Commit MetaInfo

Revisão85cc8790876733259a68bac0673bfca16d970470 (tree)
Hora2020-02-17 15:02:59
AutorEric Branlund <ebranlund@fast...>
CommiterEric Branlund

Mensagem de Log

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

Mudança Sumário

Diff

--- a/src/main-cocoa.m
+++ b/src/main-cocoa.m
@@ -473,8 +473,13 @@ static int resize_pending_changes(struct PendingChanges* pc, int nrow)
473473 * defaults */
474474 - (void)resizeTerminalWithContentRect: (NSRect)contentRect saveToDefaults: (BOOL)saveToDefaults;
475475
476-/* Change the minimum size for the window associated with the context. */
477-- (void)setMinimumWindowSize;
476+/*
477+ * Change the minimum size for the window associated with the context.
478+ * If termIdx is not negative, use it as the terminal index (that is useful
479+ * if self->terminal has not been set yet). Otherwise, [self terminalIndex]
480+ * will be used as the index.
481+ */
482+- (void)setMinimumWindowSize:(int)termIdx;
478483
479484 /* Called from the view to indicate that it is starting or ending live resize */
480485 - (void)viewWillStartLiveResize:(AngbandView *)view;
@@ -1098,7 +1103,7 @@ static int compare_advances(const void *ap, const void *bp)
10981103 * and rows since they could be changed */
10991104 NSRect contentRect = [self->primaryWindow contentRectForFrameRect: [self->primaryWindow frame]];
11001105
1101- [self setMinimumWindowSize];
1106+ [self setMinimumWindowSize:-1];
11021107 NSSize size = self->primaryWindow.contentMinSize;
11031108 BOOL windowNeedsResizing = NO;
11041109 if (contentRect.size.width < size.width) {
@@ -1684,11 +1689,14 @@ static NSMenuItem *superitem(NSMenuItem *self)
16841689 Term_activate( old );
16851690 }
16861691
1687-- (void)setMinimumWindowSize
1692+- (void)setMinimumWindowSize:(int)termIdx
16881693 {
16891694 NSSize minsize;
16901695
1691- if ([self terminalIndex] == 0) {
1696+ if (termIdx < 0) {
1697+ termIdx = [self terminalIndex];
1698+ }
1699+ if (termIdx == 0) {
16921700 minsize.width = 80;
16931701 minsize.height = 24;
16941702 } else {
@@ -2038,8 +2046,8 @@ static void Term_init_cocoa(term *t)
20382046 #endif
20392047 ];
20402048 [window setTitle:title];
2041- [context setMinimumWindowSize];
2042-
2049+ [context setMinimumWindowSize:termIdx];
2050+
20432051 /* If this is the first term, and we support full screen (Mac OS X Lion or
20442052 * later), then allow it to go full screen (sweet). Allow other terms to be
20452053 * FullScreenAuxilliary, so they can at least show up. Unfortunately in
Show on old repository browser