ui/gtk: Support versions of VTE before 0.26

This is needed for current Debian stable (Squeeze).

VTE versions before 0.26 did not support VtePty.

Lower the version requirement and use alternate code which works for Debian.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Message-id: 1361560199-28906-1-git-send-email-sw@weilnetz.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Stefan Weil 2013-02-22 20:09:59 +01:00 committed by Anthony Liguori
parent c95e3080a4
commit 28d2e5b27d
2 changed files with 7 additions and 2 deletions

2
configure vendored
View File

@ -1645,7 +1645,7 @@ fi
if test "$gtk" != "no"; then if test "$gtk" != "no"; then
if $pkg_config --exists 'gtk+-2.0 >= 2.18.0' && \ if $pkg_config --exists 'gtk+-2.0 >= 2.18.0' && \
$pkg_config --exists 'vte >= 0.26.0'; then $pkg_config --exists 'vte >= 0.24.0'; then
gtk_cflags=`$pkg_config --cflags gtk+-2.0 2>/dev/null` gtk_cflags=`$pkg_config --cflags gtk+-2.0 2>/dev/null`
gtk_libs=`$pkg_config --libs gtk+-2.0 2>/dev/null` gtk_libs=`$pkg_config --libs gtk+-2.0 2>/dev/null`
vte_cflags=`$pkg_config --cflags vte 2>/dev/null` vte_cflags=`$pkg_config --cflags vte 2>/dev/null`

View File

@ -868,7 +868,9 @@ static GSList *gd_vc_init(GtkDisplayState *s, VirtualConsole *vc, int index, GSL
const char *label; const char *label;
char buffer[32]; char buffer[32];
char path[32]; char path[32];
#if VTE_CHECK_VERSION(0, 26, 0)
VtePty *pty; VtePty *pty;
#endif
GIOChannel *chan; GIOChannel *chan;
GtkWidget *scrolled_window; GtkWidget *scrolled_window;
GtkAdjustment *vadjustment; GtkAdjustment *vadjustment;
@ -901,9 +903,12 @@ static GSList *gd_vc_init(GtkDisplayState *s, VirtualConsole *vc, int index, GSL
cfmakeraw(&tty); cfmakeraw(&tty);
tcsetattr(slave_fd, TCSAFLUSH, &tty); tcsetattr(slave_fd, TCSAFLUSH, &tty);
#if VTE_CHECK_VERSION(0, 26, 0)
pty = vte_pty_new_foreign(master_fd, NULL); pty = vte_pty_new_foreign(master_fd, NULL);
vte_terminal_set_pty_object(VTE_TERMINAL(vc->terminal), pty); vte_terminal_set_pty_object(VTE_TERMINAL(vc->terminal), pty);
#else
vte_terminal_set_pty(VTE_TERMINAL(vc->terminal), master_fd);
#endif
vte_terminal_set_scrollback_lines(VTE_TERMINAL(vc->terminal), -1); vte_terminal_set_scrollback_lines(VTE_TERMINAL(vc->terminal), -1);