GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Emacs is distributed in the hope that it will be useful,
#endif
Lisp_Object Qparent_id;
Lisp_Object Qtitle, Qname;
+Lisp_Object Qexplicit_name;
Lisp_Object Qunsplittable;
Lisp_Object Qmenu_bar_lines, Qtool_bar_lines;
Lisp_Object Qleft_fringe, Qright_fringe;
Lisp_Object Qtty_color_mode;
Lisp_Object Qtty, Qtty_type;
Lisp_Object Qwindow_system;
-Lisp_Object Qenvironment;
Lisp_Object Qfullscreen, Qfullwidth, Qfullheight, Qfullboth;
Lisp_Object Vmouse_position_function;
Lisp_Object Vmouse_highlight;
Lisp_Object Vdelete_frame_functions;
+
+int focus_follows_mouse;
\f
static void
set_menu_bar_lines_1 (window, n)
Lisp_Object frame;
char name[20];
- if (terminal->deleted)
- error ("Terminal is being deleted, can't create new frames on it");
+ if (!terminal->name)
+ error ("Terminal is not live, can't create new frames on it");
f = make_frame (1);
else
f->output_method = output_termcap;
#else
-#ifdef WINDOWSNT
- f->output_method = output_termcap;
- f->terminal = terminal;
- f->terminal->reference_count++;
- create_w32cons_output (f);
-#else
#ifdef MAC_OS8
make_mac_terminal_frame (f);
#else
FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
/* Set the top frame to the newly created frame. */
- if (FRAME_TTY (f)->top_frame
+ if (FRAMEP (FRAME_TTY (f)->top_frame)
&& FRAME_LIVE_P (XFRAME (FRAME_TTY (f)->top_frame)))
XFRAME (FRAME_TTY (f)->top_frame)->async_visible = 2; /* obscured */
FRAME_BACKGROUND_PIXEL(f) = FACE_TTY_DEFAULT_BG_COLOR;
#endif
#endif /* MAC_OS8 */
-#endif /* WINDOWSNT */
#endif /* MSDOS */
if (!noninteractive)
if (EQ (f->minibuffer_window, echo_area_window))
echo_area_window = sf->minibuffer_window;
- /* Don't allow other frames to refer to a deleted frame in their
- 'environment parameter. */
- {
- Lisp_Object tail, frame1;
- Lisp_Object env = get_frame_param (XFRAME (frame), Qenvironment);
- FOR_EACH_FRAME (tail, frame1)
- {
- if (EQ (frame, frame1) || !FRAME_LIVE_P (XFRAME (frame1)))
- continue;
- if (EQ (frame, get_frame_param (XFRAME (frame1), Qenvironment)))
- {
- store_frame_param (XFRAME (frame1), Qenvironment, env);
- if (!FRAMEP (env))
- env = frame1;
- }
- }
- }
-
/* Clear any X selections for this frame. */
#ifdef HAVE_X_WINDOWS
if (FRAME_X_P (f))
f = SELECTED_FRAME ();
x = y = Qnil;
-#ifdef HAVE_MOUSE
+#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
/* It's okay for the hook to refrain from storing anything. */
if (FRAME_TERMINAL (f)->mouse_position_hook)
(*FRAME_TERMINAL (f)->mouse_position_hook) (&f, -1,
f = SELECTED_FRAME ();
x = y = Qnil;
-#ifdef HAVE_MOUSE
+#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
/* It's okay for the hook to refrain from storing anything. */
if (FRAME_TERMINAL (f)->mouse_position_hook)
(*FRAME_TERMINAL (f)->mouse_position_hook) (&f, -1,
Fselect_frame (frame);
mouse_moveto (XINT (x), XINT (y));
}
+#else
+#ifdef HAVE_GPM
+ {
+ Fselect_frame (frame);
+ term_mouse_moveto (XINT (x), XINT (y));
+ }
+#endif
#endif
#endif
Fselect_frame (frame);
mouse_moveto (XINT (x), XINT (y));
}
+#else
+#ifdef HAVE_GPM
+ {
+ Fselect_frame (frame);
+ term_mouse_moveto (XINT (x), XINT (y));
+ }
+#endif
#endif
#endif
unspecified and reversed, take the frame's background pixel
for foreground and vice versa. */
elt = Fassq (Qforeground_color, alist);
- if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt)))
+ if (CONSP (elt) && STRINGP (XCDR (elt)))
{
if (strncmp (SDATA (XCDR (elt)),
unspecified_bg,
else
store_in_alist (&alist, Qforeground_color, tty_color_name (f, fg));
elt = Fassq (Qbackground_color, alist);
- if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt)))
+ if (CONSP (elt) && STRINGP (XCDR (elt)))
{
if (strncmp (SDATA (XCDR (elt)),
unspecified_fg,
call1 (Qframe_set_background_mode, frame);
}
}
+ return Qnil;
}
-
-DEFUN ("frame-with-environment", Fframe_with_environment, Sframe_with_environment, 0, 1, 0,
- doc: /* Return the frame that has the environment variable list for FRAME.
-
-The frame-local environment variable list is normally shared between
-frames that were created in the same Emacsclient session. The
-environment list is stored in a single frame's 'environment parameter;
-the other frames' 'environment parameter is set to this frame. This
-function follows the chain of 'environment references to reach the
-frame that stores the actual local environment list, and returns that
-frame. */)
- (frame)
- Lisp_Object frame;
-{
- Lisp_Object hare, tortoise;
-
- if (NILP (frame))
- frame = selected_frame;
- CHECK_FRAME (frame);
-
- hare = tortoise = get_frame_param (XFRAME (frame), Qenvironment);
- while (!NILP (hare) && FRAMEP (hare))
- {
- frame = hare;
- hare = get_frame_param (XFRAME (hare), Qenvironment);
- if (NILP (hare) || !FRAMEP (hare))
- break;
- frame = hare;
- hare = get_frame_param (XFRAME (hare), Qenvironment);
- tortoise = get_frame_param (XFRAME (tortoise), Qenvironment);
- if (EQ (hare, tortoise))
- error ("Cyclic frame-local environment indirection");
- }
-
- return frame;
-}
-
\f
DEFUN ("frame-char-height", Fframe_char_height, Sframe_char_height,
0, 1, 0,
prop = parms[i];
val = values[i];
- if (EQ (prop, Qwidth) && NUMBERP (val))
+ if (EQ (prop, Qwidth) && NATNUMP (val))
width = XFASTINT (val);
- else if (EQ (prop, Qheight) && NUMBERP (val))
+ else if (EQ (prop, Qheight) && NATNUMP (val))
height = XFASTINT (val);
else if (EQ (prop, Qtop))
top = val;
tem = Qnil;
else
XSETFASTINT (tem, FRAME_X_OUTPUT (f)->parent_desc);
+ store_in_alist (alistptr, Qexplicit_name, (f->explicit_name ? Qt : Qnil));
store_in_alist (alistptr, Qparent_id, tem);
}
staticpro (&Qframep);
Qframe_live_p = intern ("frame-live-p");
staticpro (&Qframe_live_p);
+ Qexplicit_name = intern ("explicit-name");
+ staticpro (&Qexplicit_name);
Qheight = intern ("height");
staticpro (&Qheight);
Qicon = intern ("icon");
staticpro (&Qtty_type);
Qwindow_system = intern ("window-system");
staticpro (&Qwindow_system);
- Qenvironment = intern ("environment");
- staticpro (&Qenvironment);
-
+
Qface_set_after_frame_default = intern ("face-set-after-frame-default");
staticpro (&Qface_set_after_frame_default);
This variable is local to the current terminal and cannot be buffer-local. */);
+ DEFVAR_BOOL ("focus-follows-mouse", &focus_follows_mouse,
+ doc: /* Non-nil if window system changes focus when you move the mouse.
+You should set this variable to tell Emacs how your window manager
+handles focus, since there is no way in general for Emacs to find out
+automatically. */);
+#ifdef HAVE_WINDOW_SYSTEM
+#if defined(HAVE_NTGUI) || defined(MAC_OS)
+ focus_follows_mouse = 0;
+#else
+ focus_follows_mouse = 1;
+#endif
+#else
+ focus_follows_mouse = 0;
+#endif
+
staticpro (&Vframe_list);
defsubr (&Sactive_minibuffer_window);
defsubr (&Sframe_parameters);
defsubr (&Sframe_parameter);
defsubr (&Smodify_frame_parameters);
- defsubr (&Sframe_with_environment);
defsubr (&Sframe_char_height);
defsubr (&Sframe_char_width);
defsubr (&Sframe_pixel_height);