Skip to content

Instantly share code, notes, and snippets.

@aaronjensen
Last active May 7, 2017 19:39
Show Gist options
  • Save aaronjensen/b3e4118f8b7072ef312eaf0a8ed2748f to your computer and use it in GitHub Desktop.
Save aaronjensen/b3e4118f8b7072ef312eaf0a8ed2748f to your computer and use it in GitHub Desktop.
---
lisp/cus-start.el | 1 +
src/nsterm.m | 19 +++++++++++++++++--
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 51a92324f2..e9fb28cb17 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -446,6 +446,7 @@ minibuffer-prompt-properties--setter
(ns-use-native-fullscreen ns boolean "24.4")
(ns-use-fullscreen-animation ns boolean "25.1")
(ns-use-srgb-colorspace ns boolean "24.4")
+ (ns-use-title-bar ns boolean "26.1")
;; process.c
(delete-exited-processes processes-basics boolean)
;; syntax.c
diff --git a/src/nsterm.m b/src/nsterm.m
index fe9b418e4d..a84b9649ff 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -6831,11 +6831,13 @@ not_in_argv (NSString *arg)
maximizing_resize = NO;
#endif
- win = [[EmacsWindow alloc]
+ win = [[EmacsFSWindow alloc]
initWithContentRect: r
styleMask: (NSResizableWindowMask |
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
- NSTitledWindowMask |
+ (ns_use_title_bar ?
+ NSTitledWindowMask :
+ NSWindowStyleMaskBorderless) |
#endif
NSMiniaturizableWindowMask |
NSClosableWindowMask)
@@ -6868,6 +6870,7 @@ not_in_argv (NSString *arg)
[win setTitle: name];
/* toolbar support */
+ if ( ns_use_title_bar ) {
toolbar = [[EmacsToolbar alloc] initForView: self withIdentifier:
[NSString stringWithFormat: @"Emacs Frame %d",
ns_window_num]];
@@ -6889,6 +6892,7 @@ not_in_argv (NSString *arg)
}
#endif
FRAME_TOOLBAR_HEIGHT (f) = 0;
+ }
tem = f->icon_name;
if (!NILP (tem))
@@ -8757,6 +8761,17 @@ Note that this does not apply to images.
This variable is ignored on Mac OS X < 10.7 and GNUstep. */);
ns_use_srgb_colorspace = YES;
+ DEFVAR_BOOL ("ns-use-title-bar", ns_use_title_bar,
+ doc: /*Non-nil to include the title bar on frames.
+ Nil to omit the title bar on OSX >= 10.7. This variable is
+ ignored on OSX < 10.7. Note that the first frame per session
+ (unless it is an emacsclient frame connecting to emacs
+ --daemon) will ignore (!) the user-set value of this variable,
+ using the default value of this variable (nil--do not include a
+ title bar). This is almost certainly due to a bug in the patch
+ adding this variable. Default is nil. */);
+ ns_use_title_bar = NO;
+
/* TODO: move to common code */
DEFVAR_LISP ("x-toolkit-scroll-bars", Vx_toolkit_scroll_bars,
doc: /* Which toolkit scroll bars Emacs uses, if any.
--
2.12.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment