From: Alan Third Date: Thu, 26 Aug 2021 18:25:48 +0000 (+0100) Subject: Allow resizing undecorated frames on macOS (bug#28512, bug#31795) X-Git-Tag: emacs-29.0.90~3499 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ab0d7a2b83fbb97788efb3ad1cd5e3b0ed10f7f4;p=emacs.git 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. --- diff --git a/src/nsterm.m b/src/nsterm.m index 8fdbacf12fe..8428c689fd6 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -453,14 +453,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); @@ -8238,10 +8230,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,