/* Generic frame functions.
- Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2003, 2004
+ Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2003, 2004, 2005
Free Software Foundation.
This file is part of GNU Emacs.
f->selected_window = root_window;
/* Make sure this window seems more recently used than
a newly-created, never-selected window. */
- XSETFASTINT (XWINDOW (f->selected_window)->use_time, ++window_select_count);
+ ++window_select_count;
+ XSETFASTINT (XWINDOW (f->selected_window)->use_time, window_select_count);
f->default_face_done_p = 0;
{
display_device = XCDR (display_device);
CHECK_NUMBER (display_device);
- d = get_display (XINT (display_device));
- if (!d)
- wrong_type_argument (Qdisplay_live_p, display_device);
+ d = get_display (XINT (display_device), 1);
}
}
return frame;
}
-DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, "e",
+DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 1, "e",
doc: /* Select the frame FRAME.
Subsequent editing commands apply to its selected window.
The selection of FRAME lasts until the next time the user does
focus. On a text-only terminal, the next redisplay will display FRAME.
This function returns FRAME, or nil if FRAME has been deleted. */)
- (frame, no_enter)
- Lisp_Object frame, no_enter;
+ (frame)
+ Lisp_Object frame;
{
return do_switch_frame (frame, 1, 0);
}
-DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 2, "e",
+DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 1, "e",
doc: /* Handle a switch-frame event EVENT.
Switch-frame events are usually bound to this function.
A switch-frame event tells Emacs that the window manager has requested
If EVENT is frame object, handle it as if it were a switch-frame event
to that frame. */)
- (event, no_enter)
- Lisp_Object event, no_enter;
+ (event)
+ Lisp_Object event;
{
/* Preserve prefix arg that the command loop just cleared. */
current_kboard->Vprefix_arg = Vcurrent_prefix_arg;
return do_switch_frame (event, 0, 0);
}
-DEFUN ("ignore-event", Fignore_event, Signore_event, 0, 0, "",
- doc: /* Do nothing, but preserve any prefix argument already specified.
-This is a suitable binding for `iconify-frame' and `make-frame-visible'. */)
- ()
-{
- current_kboard->Vprefix_arg = Vcurrent_prefix_arg;
- return Qnil;
-}
-
DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0,
doc: /* Return the frame that is now selected. */)
()
CHECK_LIVE_FRAME (frame);
- d = get_display (frame);
+ d = get_display (frame, 0);
if (!d)
return Qnil;
if (FRAME_X_P (f))
x_clear_frame_selections (f);
#endif
+#ifdef MAC_OS
+ if (FRAME_MAC_P (f))
+ x_clear_frame_selections (f);
+#endif
/* Free glyphs.
This function must be called before the window tree of the
#if defined (MSDOS) && defined (HAVE_MOUSE)
if (FRAME_MSDOS_P (XFRAME (frame)))
{
- Fselect_frame (frame, Qnil);
+ Fselect_frame (frame);
mouse_moveto (XINT (x), XINT (y));
}
#endif
#if defined (MSDOS) && defined (HAVE_MOUSE)
if (FRAME_MSDOS_P (XFRAME (frame)))
{
- Fselect_frame (frame, Qnil);
+ Fselect_frame (frame);
mouse_moveto (XINT (x), XINT (y));
}
#endif
#if 0 /* This isn't logically necessary, and it can do GC. */
/* Don't let the frame remain selected. */
if (EQ (frame, selected_frame))
- Fhandle_switch_frame (next_frame (frame, Qt), Qnil);
+ Fhandle_switch_frame (next_frame (frame, Qt));
#endif
/* Don't allow minibuf_window to remain on a deleted frame. */
prop = parms[i];
val = values[i];
store_frame_param (f, prop, val);
+
+ /* Changing the background color might change the background
+ mode, so that we have to load new defface specs.
+ Call frame-set-background-mode to do that. */
+ if (EQ (prop, Qbackground_color))
+ call1 (Qframe_set_background_mode, frame);
}
}
XSETINT (icon_top, 0);
}
-#ifndef HAVE_CARBON
- /* MAC_TODO: fullscreen */
if (FRAME_VISIBLE_P (f) && fullscreen_is_being_set)
{
/* If the frame is visible already and the fullscreen parameter is
if (new_top != f->top_pos || new_left != f->left_pos)
x_set_offset (f, new_left, new_top, 1);
}
-#endif
/* Don't set these parameters unless they've been explicitly
specified. The window might be mapped or resized while we're in
store_in_alist (alistptr, Qdisplay,
XCAR (FRAME_X_DISPLAY_INFO (f)->name_list_element));
-#ifndef HAVE_CARBON
-/* A Mac Window is identified by a struct, not an integer. */
if (FRAME_X_OUTPUT (f)->parent_desc == FRAME_X_DISPLAY_INFO (f)->root_window)
tem = Qnil;
else
XSETFASTINT (tem, FRAME_X_OUTPUT (f)->parent_desc);
store_in_alist (alistptr, Qparent_id, tem);
-#endif
}
struct frame *f;
Lisp_Object new_value, old_value;
{
-#ifndef HAVE_CARBON
if (NILP (new_value))
f->want_fullscreen = FULLSCREEN_NONE;
else if (EQ (new_value, Qfullboth))
f->want_fullscreen = FULLSCREEN_WIDTH;
else if (EQ (new_value, Qfullheight))
f->want_fullscreen = FULLSCREEN_HEIGHT;
-#endif
}
error ("The characters of the given font have varying widths");
else if (STRINGP (result))
{
+ set_default_ascii_font (result);
if (STRINGP (fontset_name))
{
/* Fontset names are built from ASCII font names, so the
if (XINT (arg) == f->border_width)
return;
-#ifndef HAVE_CARBON
+#ifndef MAC_OS
if (FRAME_X_WINDOW (f) != 0)
error ("Cannot change the border width of a window");
#endif /* MAC_TODO */
DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist,
doc: /* Alist of default values for frame creation.
These may be set in your init file, like this:
- (setq default-frame-alist '((width . 80) (height . 55) (menu-bar-lines . 1))
+ (setq default-frame-alist '((width . 80) (height . 55) (menu-bar-lines . 1)))
These override values given in window system configuration data,
including X Windows' defaults database.
For values specific to the first Emacs frame, see `initial-frame-alist'.
DEFVAR_LISP ("default-frame-scroll-bars", &Vdefault_frame_scroll_bars,
doc: /* Default position of scroll bars on this window-system. */);
#ifdef HAVE_WINDOW_SYSTEM
-#if defined(HAVE_NTGUI) || defined(HAVE_CARBON)
+#if defined(HAVE_NTGUI) || defined(MAC_OS)
/* MS-Windows has scroll bars on the right by default. */
Vdefault_frame_scroll_bars = Qright;
#else
defsubr (&Swindow_system);
defsubr (&Smake_terminal_frame);
defsubr (&Shandle_switch_frame);
- defsubr (&Signore_event);
defsubr (&Sselect_frame);
defsubr (&Sselected_frame);
defsubr (&Swindow_frame);