From dc902631e5115d6b8fed8f3b6c12bf28dd161533 Mon Sep 17 00:00:00 2001 From: Eric Branlund Date: Fri, 28 Feb 2020 13:39:38 -0800 Subject: [PATCH] Create the Angband terminals other than terminal zero as utility panels: makes the title bar thinner. Also implies some other behavioral changes which are not inconsistent with how those terminals are used. Addresses the hengbandforosx's ticket 40204. --- src/main-cocoa.m | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/main-cocoa.m b/src/main-cocoa.m index c65d721d0..37201bdd0 100644 --- a/src/main-cocoa.m +++ b/src/main-cocoa.m @@ -1989,13 +1989,25 @@ static __strong NSFont* gDefaultFont = nil; NSUInteger styleMask = NSTitledWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask; - /* Make every window other than the main window closable */ + /* + * Make every window other than the main window closable, also create + * them as utility panels to get the thinner title bar and other + * attributes that already match up with how those windows are used. + */ if ((__bridge AngbandContext*) (angband_term[0]->data) != self) { - styleMask |= NSClosableWindowMask; - } + self.primaryWindow = + [[NSPanel alloc] initWithContentRect:contentRect + styleMask:(styleMask | NSClosableWindowMask | + NSUtilityWindowMask) + backing:NSBackingStoreBuffered defer:YES]; + } else { + self.primaryWindow = + [[NSWindow alloc] initWithContentRect:contentRect + styleMask:styleMask + backing:NSBackingStoreBuffered defer:YES]; + } - self.primaryWindow = [[NSWindow alloc] initWithContentRect:contentRect styleMask: styleMask backing:NSBackingStoreBuffered defer:YES]; /* Not to be released when closed */ [self.primaryWindow setReleasedWhenClosed:NO]; -- 2.11.0