From e66bb00e3b3b62bb88d8ea2bc8acbe0558c39927 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Thu, 26 Aug 2021 19:25:48 +0100 Subject: Allow resizing undecorated frames on macOS (bug#28512, bug#31795) * src/nsterm.m (FRAME_DECORATED_FLAGS, FRAME_UNDECORATED_FLAGS): Remove unused defines. * src/nsterm.m ([EmacsWindow initWithEmacsFrame:fullscreen:screen:]): Since this is now the only place these defines are used just put them inline and add NSWindowStyleMaskResizable for undecorated frames on Cocoa. --- src/nsterm.m | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/nsterm.m b/src/nsterm.m index ede662681fa..ffd7afedfa1 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -452,14 +452,6 @@ ev_modifiers_helper (unsigned int flags, unsigned int left_mask, } -/* These flags will be OR'd or XOR'd with the NSWindow's styleMask - property depending on what we're doing. */ -#define FRAME_DECORATED_FLAGS (NSWindowStyleMaskTitled \ - | NSWindowStyleMaskResizable \ - | NSWindowStyleMaskMiniaturizable \ - | NSWindowStyleMaskClosable) -#define FRAME_UNDECORATED_FLAGS NSWindowStyleMaskBorderless - /* TODO: Get rid of need for these forward declarations. */ static void ns_condemn_scroll_bars (struct frame *f); static void ns_judge_scroll_bars (struct frame *f); @@ -8156,10 +8148,17 @@ not_in_argv (NSString *arg) if (fullscreen) styleMask = NSWindowStyleMaskBorderless; else if (FRAME_UNDECORATED (f)) - styleMask = FRAME_UNDECORATED_FLAGS; + { + styleMask = NSWindowStyleMaskBorderless; +#ifdef NS_IMPL_COCOA + styleMask |= NSWindowStyleMaskResizable; +#endif + } else - styleMask = FRAME_DECORATED_FLAGS; - + styleMask = NSWindowStyleMaskTitled + | NSWindowStyleMaskResizable + | NSWindowStyleMaskMiniaturizable + | NSWindowStyleMaskClosable; self = [super initWithContentRect: NSMakeRect (0, 0, -- cgit v1.2.1