[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/ns/testing e66bb00 6/6: Allow resizing undecorated frames on mac
From: |
Alan Third |
Subject: |
scratch/ns/testing e66bb00 6/6: Allow resizing undecorated frames on macOS (bug#28512, bug#31795) |
Date: |
Tue, 31 Aug 2021 15:51:15 -0400 (EDT) |
branch: scratch/ns/testing
commit e66bb00e3b3b62bb88d8ea2bc8acbe0558c39927
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 ede6626..ffd7afe 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,
- branch scratch/ns/testing created (now e66bb00), Alan Third, 2021/08/31
- scratch/ns/testing 32fbd55 3/6: Fix macfont backend color handling, Alan Third, 2021/08/31
- scratch/ns/testing e66bb00 6/6: Allow resizing undecorated frames on macOS (bug#28512, bug#31795),
Alan Third <=
- scratch/ns/testing f7ada2d 2/6: Further cleanup of NS color code, Alan Third, 2021/08/31
- scratch/ns/testing 4ef7ac1 4/6: Make NS toolbar use NSString instead of C strings, Alan Third, 2021/08/31
- scratch/ns/testing e8bd0b7 5/6: Make NS toolbar item ID more unique (bug#50160), Alan Third, 2021/08/31
- scratch/ns/testing 9ba21bc 1/6: Simplify NS color handling, Alan Third, 2021/08/31