emacs-diffs
[Top][All Lists]
Advanced

[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,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]