diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/frame.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/frame.c b/src/frame.c index d6154b7ab04..93c68388513 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -74,6 +74,7 @@ Lisp_Object Qbackground_mode; | |||
| 74 | Lisp_Object Qinhibit_default_face_x_resources; | 74 | Lisp_Object Qinhibit_default_face_x_resources; |
| 75 | Lisp_Object Qleft_fringe; | 75 | Lisp_Object Qleft_fringe; |
| 76 | Lisp_Object Qright_fringe; | 76 | Lisp_Object Qright_fringe; |
| 77 | Lisp_Object Qtty_color_mode; | ||
| 77 | 78 | ||
| 78 | Lisp_Object Vterminal_frame; | 79 | Lisp_Object Vterminal_frame; |
| 79 | Lisp_Object Vdefault_frame_alist; | 80 | Lisp_Object Vdefault_frame_alist; |
| @@ -641,6 +642,23 @@ do_switch_frame (frame, track, for_deletion) | |||
| 641 | 642 | ||
| 642 | Fselect_window (XFRAME (frame)->selected_window); | 643 | Fselect_window (XFRAME (frame)->selected_window); |
| 643 | 644 | ||
| 645 | #ifndef WINDOWSNT | ||
| 646 | /* Make sure to switch the tty color mode to that of the newly | ||
| 647 | selected frame. */ | ||
| 648 | sf = SELECTED_FRAME (); | ||
| 649 | if (FRAME_TERMCAP_P (sf)) | ||
| 650 | { | ||
| 651 | Lisp_Object color_mode_spec, color_mode; | ||
| 652 | |||
| 653 | color_mode_spec = assq_no_quit (Qtty_color_mode, sf->param_alist); | ||
| 654 | if (CONSP (color_mode_spec)) | ||
| 655 | color_mode = XCDR (color_mode_spec); | ||
| 656 | else | ||
| 657 | color_mode = make_number (0); | ||
| 658 | set_tty_color_mode (sf, color_mode); | ||
| 659 | } | ||
| 660 | #endif /* !WINDOWSNT */ | ||
| 661 | |||
| 644 | /* We want to make sure that the next event generates a frame-switch | 662 | /* We want to make sure that the next event generates a frame-switch |
| 645 | event to the appropriate frame. This seems kludgy to me, but | 663 | event to the appropriate frame. This seems kludgy to me, but |
| 646 | before you take it out, make sure that evaluating something like | 664 | before you take it out, make sure that evaluating something like |
| @@ -1926,6 +1944,14 @@ store_frame_param (f, prop, val) | |||
| 1926 | swap_in_global_binding (prop); | 1944 | swap_in_global_binding (prop); |
| 1927 | } | 1945 | } |
| 1928 | 1946 | ||
| 1947 | #ifndef WINDOWSNT | ||
| 1948 | /* The tty color mode needs to be set before the frame's parameter | ||
| 1949 | alist is updated with the new value, because set_tty_color_mode | ||
| 1950 | wants to look at the old mode. */ | ||
| 1951 | if (FRAME_TERMCAP_P (f) && EQ (prop, Qtty_color_mode)) | ||
| 1952 | set_tty_color_mode (f, val); | ||
| 1953 | #endif | ||
| 1954 | |||
| 1929 | /* Update the frame parameter alist. */ | 1955 | /* Update the frame parameter alist. */ |
| 1930 | old_alist_elt = Fassq (prop, f->param_alist); | 1956 | old_alist_elt = Fassq (prop, f->param_alist); |
| 1931 | if (EQ (old_alist_elt, Qnil)) | 1957 | if (EQ (old_alist_elt, Qnil)) |
| @@ -2474,6 +2500,8 @@ syms_of_frame () | |||
| 2474 | staticpro (&Qleft_fringe); | 2500 | staticpro (&Qleft_fringe); |
| 2475 | Qright_fringe = intern ("right-fringe"); | 2501 | Qright_fringe = intern ("right-fringe"); |
| 2476 | staticpro (&Qright_fringe); | 2502 | staticpro (&Qright_fringe); |
| 2503 | Qtty_color_mode = intern ("tty-color-mode"); | ||
| 2504 | staticpro (&Qtty_color_mode); | ||
| 2477 | 2505 | ||
| 2478 | DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist, | 2506 | DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist, |
| 2479 | doc: /* Alist of default values for frame creation. | 2507 | doc: /* Alist of default values for frame creation. |