comparison src/frame.c @ 97690:af1ed0096327

(make_terminal_frame): Initialize f->terminal, f->terminal->reference_count, and scroll bars on MS-DOS as well. Set the top frame to newly created frame. (Fmake_terminal_frame): Reuse the_only_display_info.
author Eli Zaretskii <eliz@gnu.org>
date Sun, 24 Aug 2008 20:11:46 +0000
parents 6358f03eb003
children 5523d496656e
comparison
equal deleted inserted replaced
97689:5f56382dc026 97690:af1ed0096327
583 sprintf (name, "F%d", tty_frame_count); 583 sprintf (name, "F%d", tty_frame_count);
584 f->name = build_string (name); 584 f->name = build_string (name);
585 585
586 f->visible = 1; /* FRAME_SET_VISIBLE wd set frame_garbaged. */ 586 f->visible = 1; /* FRAME_SET_VISIBLE wd set frame_garbaged. */
587 f->async_visible = 1; /* Don't let visible be cleared later. */ 587 f->async_visible = 1; /* Don't let visible be cleared later. */
588 f->terminal = terminal;
589 f->terminal->reference_count++;
588 #ifdef MSDOS 590 #ifdef MSDOS
589 f->output_data.tty->display_info = &the_only_display_info; 591 f->output_data.tty->display_info = &the_only_display_info;
590 if (!inhibit_window_system 592 if (!inhibit_window_system
591 && (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame)) 593 && (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame))
592 || XFRAME (selected_frame)->output_method == output_msdos_raw)) 594 || XFRAME (selected_frame)->output_method == output_msdos_raw))
612 else 614 else
613 f->output_method = output_termcap; 615 f->output_method = output_termcap;
614 #else 616 #else
615 { 617 {
616 f->output_method = output_termcap; 618 f->output_method = output_termcap;
617 f->terminal = terminal;
618 f->terminal->reference_count++;
619 create_tty_output (f); 619 create_tty_output (f);
620 620
621 FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR; 621 FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
622 FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR; 622 FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
623
624 FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
625 FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
626
627 /* Set the top frame to the newly created frame. */
628 if (FRAMEP (FRAME_TTY (f)->top_frame)
629 && FRAME_LIVE_P (XFRAME (FRAME_TTY (f)->top_frame)))
630 XFRAME (FRAME_TTY (f)->top_frame)->async_visible = 2; /* obscured */
631
632 FRAME_TTY (f)->top_frame = frame;
633 } 623 }
634 624
635 #ifdef CANNOT_DUMP 625 #ifdef CANNOT_DUMP
636 FRAME_FOREGROUND_PIXEL(f) = FACE_TTY_DEFAULT_FG_COLOR; 626 FRAME_FOREGROUND_PIXEL(f) = FACE_TTY_DEFAULT_FG_COLOR;
637 FRAME_BACKGROUND_PIXEL(f) = FACE_TTY_DEFAULT_BG_COLOR; 627 FRAME_BACKGROUND_PIXEL(f) = FACE_TTY_DEFAULT_BG_COLOR;
638 #endif 628 #endif
639 #endif /* MSDOS */ 629 #endif /* MSDOS */
630
631 FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
632 FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
633
634 /* Set the top frame to the newly created frame. */
635 if (FRAMEP (FRAME_TTY (f)->top_frame)
636 && FRAME_LIVE_P (XFRAME (FRAME_TTY (f)->top_frame)))
637 XFRAME (FRAME_TTY (f)->top_frame)->async_visible = 2; /* obscured */
638
639 FRAME_TTY (f)->top_frame = frame;
640 640
641 if (!noninteractive) 641 if (!noninteractive)
642 init_frame_faces (f); 642 init_frame_faces (f);
643 643
644 return f; 644 return f;
715 if (!NILP (terminal)) 715 if (!NILP (terminal))
716 { 716 {
717 terminal = XCDR (terminal); 717 terminal = XCDR (terminal);
718 t = get_terminal (terminal, 1); 718 t = get_terminal (terminal, 1);
719 } 719 }
720 }
721
722 if (!t)
723 {
724 #ifdef MSDOS 720 #ifdef MSDOS
721 if (t && t != the_only_display_info.terminal)
725 /* msdos.c assumes a single tty_display_info object. */ 722 /* msdos.c assumes a single tty_display_info object. */
726 error ("Multiple terminals are not supported on this platform"); 723 error ("Multiple terminals are not supported on this platform");
727 #else /* !MSDOS */ 724 if (!t)
725 t = the_only_display_info.terminal;
726 #endif
727 }
728
729 if (!t)
730 {
728 char *name = 0, *type = 0; 731 char *name = 0, *type = 0;
729 Lisp_Object tty, tty_type; 732 Lisp_Object tty, tty_type;
730 733
731 tty = get_future_frame_param 734 tty = get_future_frame_param
732 (Qtty, parms, (FRAME_TERMCAP_P (XFRAME (selected_frame)) 735 (Qtty, parms, (FRAME_TERMCAP_P (XFRAME (selected_frame))
749 strncpy (type, SDATA (tty_type), SBYTES (tty_type)); 752 strncpy (type, SDATA (tty_type), SBYTES (tty_type));
750 type[SBYTES (tty_type)] = 0; 753 type[SBYTES (tty_type)] = 0;
751 } 754 }
752 755
753 t = init_tty (name, type, 0); /* Errors are not fatal. */ 756 t = init_tty (name, type, 0); /* Errors are not fatal. */
754 #endif /* !MSDOS */
755 } 757 }
756 758
757 f = make_terminal_frame (t); 759 f = make_terminal_frame (t);
758 760
759 { 761 {