summaryrefslogtreecommitdiff
path: root/src/nsfns.m
diff options
context:
space:
mode:
Diffstat (limited to 'src/nsfns.m')
-rw-r--r--src/nsfns.m52
1 files changed, 18 insertions, 34 deletions
diff --git a/src/nsfns.m b/src/nsfns.m
index 5c4cc915e7c..c40367703db 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -668,23 +668,7 @@ ns_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
}
}
- {
- int inhibit
- = ((f->after_make_frame
- && !f->tool_bar_resized
- && (EQ (frame_inhibit_implied_resize, Qt)
- || (CONSP (frame_inhibit_implied_resize)
- && !NILP (Fmemq (Qtool_bar_lines,
- frame_inhibit_implied_resize))))
- && NILP (get_frame_param (f, Qfullscreen)))
- ? 0
- : 2);
-
- NSTRACE_MSG ("inhibit:%d", inhibit);
-
- frame_size_history_add (f, Qupdate_frame_tool_bar, 0, 0, Qnil);
- adjust_frame_size (f, -1, -1, inhibit, 0, Qtool_bar_lines);
- }
+ adjust_frame_size (f, -1, -1, 2, false, Qtool_bar_lines);
}
static void
@@ -963,11 +947,7 @@ frame_parm_handler ns_frame_parm_handlers[] =
0, /* x_set_sticky */
0, /* x_set_tool_bar_position */
0, /* x_set_inhibit_double_buffering */
-#ifdef NS_IMPL_COCOA
ns_set_undecorated,
-#else
- 0, /* ns_set_undecorated */
-#endif
ns_set_parent_frame,
0, /* x_set_skip_taskbar */
ns_set_no_focus_on_map,
@@ -1082,7 +1062,6 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
Lisp_Object parent, parent_frame;
struct kboard *kb;
static int desc_ctr = 1;
- int x_width = 0, x_height = 0;
/* gui_display_get_arg modifies parms. */
parms = Fcopy_alist (parms);
@@ -1332,8 +1311,7 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
RES_TYPE_STRING);
parms = get_geometry_from_preferences (dpyinfo, parms);
- window_prompting = gui_figure_window_size (f, parms, false, true,
- &x_width, &x_height);
+ window_prompting = gui_figure_window_size (f, parms, false, true);
tem = gui_display_get_arg (dpyinfo, parms, Qunsplittable, 0, 0,
RES_TYPE_BOOLEAN);
@@ -1400,13 +1378,8 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
/* Allow set_window_size_hook, now. */
f->can_set_window_size = true;
- if (x_width > 0)
- SET_FRAME_WIDTH (f, x_width);
- if (x_height > 0)
- SET_FRAME_HEIGHT (f, x_height);
-
- adjust_frame_size (f, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 0, 1,
- Qx_create_frame_2);
+ adjust_frame_size (f, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f),
+ 0, true, Qx_create_frame_2);
if (! f->output_data.ns->explicit_parent)
{
@@ -1427,6 +1400,7 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
else
{
/* Must have been Qnil. */
+ f->was_invisible = true;
}
}
@@ -1975,8 +1949,11 @@ DEFUN ("ns-hide-emacs", Fns_hide_emacs, Sns_hide_emacs,
doc: /* If ON is non-nil, the entire Emacs application is hidden.
Otherwise if Emacs is hidden, it is unhidden.
If ON is equal to `activate', Emacs is unhidden and becomes
-the active application. */)
- (Lisp_Object on)
+the active application.
+If ON is equal to `activate-front', Emacs is unhidden and
+becomes the active application, but only the selected frame
+is layered in front of the windows of other applications. */)
+ (Lisp_Object on)
{
check_window_system (NULL);
if (EQ (on, intern ("activate")))
@@ -1984,6 +1961,12 @@ the active application. */)
[NSApp unhide: NSApp];
[NSApp activateIgnoringOtherApps: YES];
}
+ else if (EQ (on, intern ("activate-front")))
+ {
+ [NSApp unhide: NSApp];
+ [[NSRunningApplication currentApplication]
+ activateWithOptions: NSApplicationActivateIgnoringOtherApps];
+ }
else if (NILP (on))
[NSApp unhide: NSApp];
else
@@ -3046,7 +3029,8 @@ all_nonzero_ascii (unsigned char *str, ptrdiff_t n)
}
@implementation NSString (EmacsString)
-/* Make an NSString from a Lisp string. */
+/* Make an NSString from a Lisp string. STRING must not be in an
+ encoded form (e.g. UTF-8). */
+ (NSString *)stringWithLispString:(Lisp_Object)string
{
/* Shortcut for the common case. */