summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Third <alan@idiocy.org>2021-08-26 19:25:48 +0100
committerAlan Third <alan@idiocy.org>2021-08-31 20:50:12 +0100
commite66bb00e3b3b62bb88d8ea2bc8acbe0558c39927 (patch)
treee2e70991b01672fd1b596c10b905d8064c0572cf
parente8bd0b720ab71e4ba884891bbe3dd1b1fa740298 (diff)
downloademacs-scratch/ns/testing.tar.gz
Allow resizing undecorated frames on macOS (bug#28512, bug#31795)scratch/ns/testing
* 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.
-rw-r--r--src/nsterm.m21
1 files 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,