aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Third2021-08-26 19:25:48 +0100
committerAlan Third2021-12-22 20:48:19 +0000
commitab0d7a2b83fbb97788efb3ad1cd5e3b0ed10f7f4 (patch)
treef1b3170eac4ff350bdd1d436b83be0bbb597d849 /src
parent89749a62b51e19a39f145a1985ae5992c58c6776 (diff)
downloademacs-ab0d7a2b83fbb97788efb3ad1cd5e3b0ed10f7f4.tar.gz
emacs-ab0d7a2b83fbb97788efb3ad1cd5e3b0ed10f7f4.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/nsterm.m21
1 files changed, 10 insertions, 11 deletions
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,
453 } 453 }
454 454
455 455
456/* These flags will be OR'd or XOR'd with the NSWindow's styleMask
457 property depending on what we're doing. */
458#define FRAME_DECORATED_FLAGS (NSWindowStyleMaskTitled \
459 | NSWindowStyleMaskResizable \
460 | NSWindowStyleMaskMiniaturizable \
461 | NSWindowStyleMaskClosable)
462#define FRAME_UNDECORATED_FLAGS NSWindowStyleMaskBorderless
463
464/* TODO: Get rid of need for these forward declarations. */ 456/* TODO: Get rid of need for these forward declarations. */
465static void ns_condemn_scroll_bars (struct frame *f); 457static void ns_condemn_scroll_bars (struct frame *f);
466static void ns_judge_scroll_bars (struct frame *f); 458static void ns_judge_scroll_bars (struct frame *f);
@@ -8238,10 +8230,17 @@ not_in_argv (NSString *arg)
8238 if (fullscreen) 8230 if (fullscreen)
8239 styleMask = NSWindowStyleMaskBorderless; 8231 styleMask = NSWindowStyleMaskBorderless;
8240 else if (FRAME_UNDECORATED (f)) 8232 else if (FRAME_UNDECORATED (f))
8241 styleMask = FRAME_UNDECORATED_FLAGS; 8233 {
8234 styleMask = NSWindowStyleMaskBorderless;
8235#ifdef NS_IMPL_COCOA
8236 styleMask |= NSWindowStyleMaskResizable;
8237#endif
8238 }
8242 else 8239 else
8243 styleMask = FRAME_DECORATED_FLAGS; 8240 styleMask = NSWindowStyleMaskTitled
8244 8241 | NSWindowStyleMaskResizable
8242 | NSWindowStyleMaskMiniaturizable
8243 | NSWindowStyleMaskClosable;
8245 8244
8246 self = [super initWithContentRect: 8245 self = [super initWithContentRect:
8247 NSMakeRect (0, 0, 8246 NSMakeRect (0, 0,