[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/ns/testing 6ab3dc1 7/7: Allow resizing undecorated frames on mac
From: |
Alan Third |
Subject: |
scratch/ns/testing 6ab3dc1 7/7: Allow resizing undecorated frames on macOS (bug#28512, bug#31795) |
Date: |
Sun, 14 Nov 2021 13:50:27 -0500 (EST) |
branch: scratch/ns/testing
commit 6ab3dc17956d541f31bd9a081a6b2b099597db12
Author: Alan Third <alan@idiocy.org>
Commit: Alan Third <alan@idiocy.org>
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 7701b0f..a24b132 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);
@@ -8190,10 +8182,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,
- branch scratch/ns/testing created (now 6ab3dc1), Alan Third, 2021/11/14
- scratch/ns/testing 2dd414a 2/7: Simplify NS color handling, Alan Third, 2021/11/14
- scratch/ns/testing 5e4ba5c 1/7: Only set LANG if the ID is valid, Alan Third, 2021/11/14
- scratch/ns/testing 9eadfb7 5/7: Make NS toolbar use NSString instead of C strings, Alan Third, 2021/11/14
- scratch/ns/testing 7d2c360 6/7: Make NS toolbar item ID more unique (bug#50160), Alan Third, 2021/11/14
- scratch/ns/testing bc3b8f3 3/7: Further cleanup of NS color code, Alan Third, 2021/11/14
- scratch/ns/testing ee8e8af 4/7: Fix macfont backend color handling, Alan Third, 2021/11/14
- scratch/ns/testing 6ab3dc1 7/7: Allow resizing undecorated frames on macOS (bug#28512, bug#31795),
Alan Third <=