summaryrefslogtreecommitdiff
path: root/src/macfns.c
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2006-02-12 00:15:44 +0000
committerKaroly Lorentey <lorentey@elte.hu>2006-02-12 00:15:44 +0000
commit1913a2b35da45eeeb71ef851975be7d57c11de78 (patch)
tree6cd59883fb931999da5b62c03b321ade6f77e66e /src/macfns.c
parenta5805c9d0240fab504f2a3e32db6449392005fb6 (diff)
parenta528b71e55b2b244a5dd35318713ccb20398cbbf (diff)
downloademacs-1913a2b35da45eeeb71ef851975be7d57c11de78.tar.gz
emacs-1913a2b35da45eeeb71ef851975be7d57c11de78.tar.bz2
emacs-1913a2b35da45eeeb71ef851975be7d57c11de78.zip
Merged from emacs@sv.gnu.org
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-49 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-50 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-51 Make constrain-to-field notice overlays * emacs@sv.gnu.org/emacs--devo--0--patch-52 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-53 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-54 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-55 Merge from erc--emacs--0 * emacs@sv.gnu.org/emacs--devo--0--patch-56 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-57 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-58 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-59 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-60 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-61 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-62 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-63 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-64 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-65 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-66 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-67 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-68 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-69 rcirc: Add flexible response formatting; Add nick abbrevs * emacs@sv.gnu.org/emacs--devo--0--patch-70 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-71 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-72 Update from CVS: man/dired.texi (Tumme): More tumme documentation. * emacs@sv.gnu.org/gnus--rel--5.10--patch-18 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-19 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-20 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-21 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-22 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-23 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-24 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-25 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-26 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-27 Update from CVS: lisp/gnus.el: Remove bogus comment. * emacs@sv.gnu.org/gnus--rel--5.10--patch-28 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-29 Add sendmail.el and smptmail.el from Emacs tree to contrib/ git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-508
Diffstat (limited to 'src/macfns.c')
-rw-r--r--src/macfns.c79
1 files changed, 58 insertions, 21 deletions
diff --git a/src/macfns.c b/src/macfns.c
index 110b697ce5e..b6ef85bcd9f 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -1,6 +1,6 @@
/* Graphical user interface functions for Mac OS.
Copyright (C) 2000, 2001, 2002, 2003, 2004,
- 2005 Free Software Foundation, Inc.
+ 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -1448,7 +1448,8 @@ x_set_mouse_color (f, arg, oldval)
BLOCK_INPUT;
- rif->define_frame_cursor (f, cursor);
+ if (FRAME_MAC_WINDOW (f) != 0)
+ rif->define_frame_cursor (f, cursor);
f->output_data.mac->text_cursor = cursor;
f->output_data.mac->nontext_cursor = nontext_cursor;
@@ -2398,11 +2399,12 @@ This function is an internal primitive--use `make-frame' instead. */)
struct mac_display_info *dpyinfo = NULL;
Lisp_Object parent;
struct kboard *kb;
- char x_frame_name[10];
static int x_frame_count = 2; /* begins at 2 because terminal frame is F1 */
check_mac ();
+ parms = Fcopy_alist (parms);
+
/* Use this general default value to start with
until we know if this frame has a specified name. */
Vx_resource_name = Vinvocation_name;
@@ -2452,18 +2454,6 @@ This function is an internal primitive--use `make-frame' instead. */)
else
f = make_frame (1);
- if (EQ (name, Qunbound) || NILP (name))
- {
- sprintf (x_frame_name, "F%d", x_frame_count++);
- f->name = build_string (x_frame_name);
- f->explicit_name = 0;
- }
- else
- {
- f->name = name;
- f->explicit_name = 1;
- }
-
XSETFRAME (frame, f);
/* Note that X Windows does support scroll bars. */
@@ -2544,7 +2534,7 @@ This function is an internal primitive--use `make-frame' instead. */)
font = x_new_font (f, "-ETL-fixed-medium-r-*--*-160-*-*-*-*-iso8859-1");
/* If those didn't work, look for something which will at least work. */
if (! STRINGP (font))
- font = x_new_fontset (f, "fontset-mac");
+ font = x_new_fontset (f, "fontset-standard");
if (! STRINGP (font))
font = x_new_font (f, "-*-monaco-*-12-*-mac-roman");
if (! STRINGP (font))
@@ -2679,17 +2669,28 @@ This function is an internal primitive--use `make-frame' instead. */)
if (EQ (visibility, Qunbound))
visibility = Qt;
-#if 0 /* MAC_TODO: really no iconify on Mac */
if (EQ (visibility, Qicon))
x_iconify_frame (f);
- else
-#endif
- if (! NILP (visibility))
+ else if (! NILP (visibility))
x_make_frame_visible (f);
else
/* Must have been Qnil. */
;
}
+
+ /* Initialize `default-minibuffer-frame' in case this is the first
+ frame on this display device. */
+ if (FRAME_HAS_MINIBUF_P (f)
+ && (!FRAMEP (kb->Vdefault_minibuffer_frame)
+ || !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame))))
+ kb->Vdefault_minibuffer_frame = frame;
+
+ /* All remaining specified parameters, which have not been "used"
+ by x_get_arg and friends, now go in the misc. alist of the frame. */
+ for (tem = parms; !NILP (tem); tem = XCDR (tem))
+ if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
+ f->param_alist = Fcons (XCAR (tem), f->param_alist);
+
UNGCPRO;
/* Make sure windows on this frame appear in calls to next-window
@@ -2699,9 +2700,11 @@ This function is an internal primitive--use `make-frame' instead. */)
return unbind_to (count, frame);
}
+
/* FRAME is used only to get a handle on the X display. We don't pass the
display info directly because we're called from frame.c, which doesn't
know about that structure. */
+
Lisp_Object
x_get_focus_frame (frame)
struct frame *frame;
@@ -2714,6 +2717,39 @@ x_get_focus_frame (frame)
XSETFRAME (xfocus, dpyinfo->x_focus_frame);
return xfocus;
}
+
+
+DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0,
+ doc: /* Set the input focus to FRAME.
+FRAME nil means use the selected frame. */)
+ (frame)
+ Lisp_Object frame;
+{
+ struct frame *f = check_x_frame (frame);
+ struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
+
+ if (dpyinfo->x_focus_frame != f)
+ {
+ BLOCK_INPUT;
+#ifdef MAC_OSX
+ ActivateWindow (ActiveNonFloatingWindow (), false);
+ ActivateWindow (FRAME_MAC_WINDOW (f), true);
+#else
+#if !TARGET_API_MAC_CARBON
+ /* SelectWindow (Non-Carbon) does not issue deactivate events if
+ the possibly inactive window that is to be selected is
+ already the frontmost one. */
+ SendBehind (FRAME_MAC_WINDOW (f), NULL);
+#endif
+ /* This brings the window to the front. */
+ SelectWindow (FRAME_MAC_WINDOW (f));
+#endif
+ UNBLOCK_INPUT;
+ }
+
+ return Qnil;
+}
+
DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
doc: /* Internal function called by `color-defined-p', which see. */)
@@ -3664,7 +3700,7 @@ x_create_tip_frame (dpyinfo, parms, text)
font = x_new_font (f, "-ETL-fixed-medium-r-*--*-160-*-*-*-*-iso8859-1");
/* If those didn't work, look for something which will at least work. */
if (! STRINGP (font))
- font = x_new_fontset (f, "fontset-mac");
+ font = x_new_fontset (f, "fontset-standard");
if (! STRINGP (font))
font = x_new_font (f, "-*-monaco-*-12-*-mac-roman");
if (! STRINGP (font))
@@ -4513,6 +4549,7 @@ Chinese, Japanese, and Korean. */);
defsubr (&Sx_close_connection);
defsubr (&Sx_display_list);
defsubr (&Sx_synchronize);
+ defsubr (&Sx_focus_frame);
/* Setting callback functions for fontset handler. */
get_font_info_func = x_get_font_info;