diff options
| author | Alan Third | 2021-08-26 19:25:48 +0100 |
|---|---|---|
| committer | Alan Third | 2021-11-14 18:48:15 +0000 |
| commit | 6ab3dc17956d541f31bd9a081a6b2b099597db12 (patch) | |
| tree | fa191858fc1e7056472edce2e05ed8c7f8f8b381 | |
| parent | 7d2c360a6b4450107beeb9be55d1bc0266c52201 (diff) | |
| download | emacs-scratch/ns/testing.tar.gz emacs-scratch/ns/testing.zip | |
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.m | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/nsterm.m b/src/nsterm.m index 7701b0f386b..a24b132ffc5 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. */ |
| 465 | static void ns_condemn_scroll_bars (struct frame *f); | 457 | static void ns_condemn_scroll_bars (struct frame *f); |
| 466 | static void ns_judge_scroll_bars (struct frame *f); | 458 | static void ns_judge_scroll_bars (struct frame *f); |
| @@ -8190,10 +8182,17 @@ not_in_argv (NSString *arg) | |||
| 8190 | if (fullscreen) | 8182 | if (fullscreen) |
| 8191 | styleMask = NSWindowStyleMaskBorderless; | 8183 | styleMask = NSWindowStyleMaskBorderless; |
| 8192 | else if (FRAME_UNDECORATED (f)) | 8184 | else if (FRAME_UNDECORATED (f)) |
| 8193 | styleMask = FRAME_UNDECORATED_FLAGS; | 8185 | { |
| 8186 | styleMask = NSWindowStyleMaskBorderless; | ||
| 8187 | #ifdef NS_IMPL_COCOA | ||
| 8188 | styleMask |= NSWindowStyleMaskResizable; | ||
| 8189 | #endif | ||
| 8190 | } | ||
| 8194 | else | 8191 | else |
| 8195 | styleMask = FRAME_DECORATED_FLAGS; | 8192 | styleMask = NSWindowStyleMaskTitled |
| 8196 | 8193 | | NSWindowStyleMaskResizable | |
| 8194 | | NSWindowStyleMaskMiniaturizable | ||
| 8195 | | NSWindowStyleMaskClosable; | ||
| 8197 | 8196 | ||
| 8198 | self = [super initWithContentRect: | 8197 | self = [super initWithContentRect: |
| 8199 | NSMakeRect (0, 0, | 8198 | NSMakeRect (0, 0, |