/* Terminal control module for terminals described by TERMCAP
- Copyright (C) 1985-1987, 1993-1995, 1998, 2000-2013 Free Software
+ Copyright (C) 1985-1987, 1993-1995, 1998, 2000-2014 Free Software
Foundation, Inc.
This file is part of GNU Emacs.
CONDITIONAL_REASSIGN ("kD", "kI", "insert");
/* if there's no key_end keycap, map key_ll to 'end' keysym */
CONDITIONAL_REASSIGN ("@7", "kH", "end");
-
- /* IBM has their own non-standard dialect of terminfo.
- If the standard name isn't found, try the IBM name. */
- CONDITIONAL_REASSIGN ("kB", "KO", "backtab");
- CONDITIONAL_REASSIGN ("@4", "kJ", "execute"); /* actually "action" */
- CONDITIONAL_REASSIGN ("@4", "kc", "execute"); /* actually "command" */
- CONDITIONAL_REASSIGN ("%7", "ki", "menu");
- CONDITIONAL_REASSIGN ("@7", "kw", "end");
- CONDITIONAL_REASSIGN ("F1", "k<", "f11");
- CONDITIONAL_REASSIGN ("F2", "k>", "f12");
- CONDITIONAL_REASSIGN ("%1", "kq", "help");
- CONDITIONAL_REASSIGN ("*6", "kU", "select");
#undef CONDITIONAL_REASSIGN
}
was suspended. */
get_tty_size (fileno (t->display_info.tty->input), &width, &height);
if (width != old_width || height != old_height)
- change_frame_size (f, height, width, 0, 0, 0);
+ change_frame_size (f, width, height, 0, 0, 0, 0);
SET_FRAME_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1);
}
Menus
***********************************************************************/
-#if defined (HAVE_MENUS) && !defined (MSDOS)
+#if !defined (MSDOS)
/* TTY menu implementation and main ideas are borrowed from msdos.c.
/* Make sure every row is enabled, or else update_frame will not
redraw them. (Rows that are identical to what is already on
screen will not be redrawn anyway.) */
- to->enabled_p = 1;
+ to->enabled_p = true;
to->hash = from->hash;
}
tty->showing_menu = 0;
do_mouse_tracking = saved_mouse_tracking;
- if (EQ (cmd, Qt) || EQ (cmd, Qtty_menu_exit))
+ if (EQ (cmd, Qt) || EQ (cmd, Qtty_menu_exit)
+ /* If some input switched frames under our feet, exit the
+ menu, since the menu faces are no longer valid, and the
+ menu is no longer relevant anyway. */
+ || sf != SELECTED_FRAME ())
return MI_QUIT_MENU;
if (EQ (cmd, Qtty_menu_mouse_movement))
mouse_get_xy (x, y);
case TTYM_IA_SELECT:
break;
case TTYM_NO_SELECT:
+ /* If the selected frame was changed while we displayed a menu,
+ throw to top level in order to undo any temporary settings
+ made by TTY menu code. */
+ if (f != SELECTED_FRAME ())
+ Ftop_level ();
/* Make "Cancel" equivalent to C-g unless FOR_CLICK (which means
the menu was invoked with a mouse event as POSITION). */
if (! for_click)
return entry;
}
-#endif /* HAVE_MENUS && !MSDOS */
+#endif /* !MSDOS */
\f
#ifndef MSDOS
***********************************************************************/
/* Initialize the tty-dependent part of frame F. The frame must
- already have its device initialized. */
+ already have its device initialized. */
void
create_tty_output (struct frame *f)
f->output_data.tty = t;
}
-/* Delete frame F's face cache, and its tty-dependent part. */
+/* Delete frame F's face cache, and its tty-dependent part. */
static void
tty_free_frame_resources (struct frame *f)
{
eassert (FRAME_TERMCAP_P (f));
-
- if (FRAME_FACE_CACHE (f))
- free_frame_faces (f);
-
+ free_frame_faces (f);
xfree (f->output_data.tty);
}
#else /* MSDOS */
-/* Delete frame F's face cache. */
+/* Delete frame F's face cache. */
static void
tty_free_frame_resources (struct frame *f)
{
eassert (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f));
-
- if (FRAME_FACE_CACHE (f))
- free_frame_faces (f);
+ free_frame_faces (f);
}
#endif /* MSDOS */
\f