diff options
| author | Stefan Monnier | 2008-04-09 03:25:14 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-04-09 03:25:14 +0000 |
| commit | 9b2cd403209d7fa25b310b29a2f0a570865fbbb3 (patch) | |
| tree | 3b63c80a0539168cbe49aaffcce1a1ef0ca9469a /src/frame.c | |
| parent | 84cb7b4562d2075284f15bcc832d156d0cf0d71a (diff) | |
| download | emacs-9b2cd403209d7fa25b310b29a2f0a570865fbbb3.tar.gz emacs-9b2cd403209d7fa25b310b29a2f0a570865fbbb3.zip | |
* xdisp.c (redisplay_internal): Reset tty's color_mode when switching
to another frame.
* frame.c (do_switch_frame): Refine the top_frame/async_visible code.
Don't call set_tty_color_mode.
(store_frame_param): Reset previous_frame rather than call
set_tty_color_mode.
* term.c (set_tty_color_mode): Rewrite.
* dispextern.h (set_tty_color_mode): New type.
* termchar.h (struct tty_display_info): Add `previous_color_mode'.
Diffstat (limited to 'src/frame.c')
| -rw-r--r-- | src/frame.c | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/src/frame.c b/src/frame.c index 81b91924d2f..188e1d18717 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -869,11 +869,11 @@ do_switch_frame (frame, track, for_deletion) | |||
| 869 | if (!for_deletion && FRAME_HAS_MINIBUF_P (sf)) | 869 | if (!for_deletion && FRAME_HAS_MINIBUF_P (sf)) |
| 870 | resize_mini_window (XWINDOW (FRAME_MINIBUF_WINDOW (sf)), 1); | 870 | resize_mini_window (XWINDOW (FRAME_MINIBUF_WINDOW (sf)), 1); |
| 871 | 871 | ||
| 872 | if (FRAME_TERMCAP_P (XFRAME (selected_frame)) | 872 | if (FRAME_TERMCAP_P (XFRAME (frame))) |
| 873 | && FRAME_TERMCAP_P (XFRAME (frame)) | ||
| 874 | && FRAME_TTY (XFRAME (selected_frame)) == FRAME_TTY (XFRAME (frame))) | ||
| 875 | { | 873 | { |
| 876 | XFRAME (selected_frame)->async_visible = 2; /* obscured */ | 874 | if (FRAMEP (FRAME_TTY (XFRAME (frame))->top_frame)) |
| 875 | /* Mark previously displayed frame as now obscured. */ | ||
| 876 | XFRAME (FRAME_TTY (XFRAME (frame))->top_frame)->async_visible = 2; | ||
| 877 | XFRAME (frame)->async_visible = 1; | 877 | XFRAME (frame)->async_visible = 1; |
| 878 | FRAME_TTY (XFRAME (frame))->top_frame = frame; | 878 | FRAME_TTY (XFRAME (frame))->top_frame = frame; |
| 879 | } | 879 | } |
| @@ -884,23 +884,6 @@ do_switch_frame (frame, track, for_deletion) | |||
| 884 | 884 | ||
| 885 | Fselect_window (XFRAME (frame)->selected_window, Qnil); | 885 | Fselect_window (XFRAME (frame)->selected_window, Qnil); |
| 886 | 886 | ||
| 887 | #ifndef WINDOWSNT | ||
| 888 | /* Make sure to switch the tty color mode to that of the newly | ||
| 889 | selected frame. */ | ||
| 890 | sf = SELECTED_FRAME (); | ||
| 891 | if (FRAME_TERMCAP_P (sf)) | ||
| 892 | { | ||
| 893 | Lisp_Object color_mode_spec, color_mode; | ||
| 894 | |||
| 895 | color_mode_spec = assq_no_quit (Qtty_color_mode, sf->param_alist); | ||
| 896 | if (CONSP (color_mode_spec)) | ||
| 897 | color_mode = XCDR (color_mode_spec); | ||
| 898 | else | ||
| 899 | color_mode = make_number (0); | ||
| 900 | set_tty_color_mode (sf, color_mode); | ||
| 901 | } | ||
| 902 | #endif /* !WINDOWSNT */ | ||
| 903 | |||
| 904 | /* We want to make sure that the next event generates a frame-switch | 887 | /* We want to make sure that the next event generates a frame-switch |
| 905 | event to the appropriate frame. This seems kludgy to me, but | 888 | event to the appropriate frame. This seems kludgy to me, but |
| 906 | before you take it out, make sure that evaluating something like | 889 | before you take it out, make sure that evaluating something like |
| @@ -2302,11 +2285,13 @@ store_frame_param (f, prop, val) | |||
| 2302 | } | 2285 | } |
| 2303 | 2286 | ||
| 2304 | #ifndef WINDOWSNT | 2287 | #ifndef WINDOWSNT |
| 2305 | /* The tty color mode needs to be set before the frame's parameter | 2288 | /* The tty color needed to be set before the frame's parameter |
| 2306 | alist is updated with the new value, because set_tty_color_mode | 2289 | alist was updated with the new value. This is not true any more, |
| 2307 | wants to look at the old mode. */ | 2290 | but we still do this test early on. */ |
| 2308 | if (FRAME_TERMCAP_P (f) && EQ (prop, Qtty_color_mode)) | 2291 | if (FRAME_TERMCAP_P (f) && EQ (prop, Qtty_color_mode) |
| 2309 | set_tty_color_mode (f, val); | 2292 | && f == FRAME_TTY (f)->previous_frame) |
| 2293 | /* Force redisplay of this tty. */ | ||
| 2294 | FRAME_TTY (f)->previous_frame = NULL; | ||
| 2310 | #endif | 2295 | #endif |
| 2311 | 2296 | ||
| 2312 | /* Update the frame parameter alist. */ | 2297 | /* Update the frame parameter alist. */ |