From patchwork Fri Feb 22 19:09:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 222617 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AF3F42C02A2 for ; Sat, 23 Feb 2013 06:10:46 +1100 (EST) Received: from localhost ([::1]:49717 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8y16-0000TE-IQ for incoming@patchwork.ozlabs.org; Fri, 22 Feb 2013 14:10:44 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8y0s-0008Tb-2W for qemu-devel@nongnu.org; Fri, 22 Feb 2013 14:10:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8y0e-0004zt-67 for qemu-devel@nongnu.org; Fri, 22 Feb 2013 14:10:24 -0500 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:60715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8y0d-0004w0-QO for qemu-devel@nongnu.org; Fri, 22 Feb 2013 14:10:16 -0500 Received: from localhost (v220110690675601.yourvserver.net.local [127.0.0.1]) by v220110690675601.yourvserver.net (Postfix) with ESMTP id 8F21C7280047; Fri, 22 Feb 2013 20:10:07 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at weilnetz.de Received: from v220110690675601.yourvserver.net ([127.0.0.1]) by localhost (v220110690675601.yourvserver.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uVX9Yh8BftXc; Fri, 22 Feb 2013 20:09:59 +0100 (CET) Received: by v220110690675601.yourvserver.net (Postfix, from userid 1000) id EBE54728004A; Fri, 22 Feb 2013 20:09:59 +0100 (CET) From: Stefan Weil To: qemu-devel@nongnu.org Date: Fri, 22 Feb 2013 20:09:59 +0100 Message-Id: <1361560199-28906-1-git-send-email-sw@weilnetz.de> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 78.47.199.172 Cc: Stefan Weil , Anthony Liguori Subject: [Qemu-devel] [PATCH v2] ui/gtk: Support versions of VTE before 0.26 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- v2: Fixed version in subject and preprocessor code. configure | 2 +- ui/gtk.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 0eb25dd..d62ad7a 100755 --- a/configure +++ b/configure @@ -1645,7 +1645,7 @@ fi if test "$gtk" != "no"; then 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_libs=`$pkg_config --libs gtk+-2.0 2>/dev/null` vte_cflags=`$pkg_config --cflags vte 2>/dev/null` diff --git a/ui/gtk.c b/ui/gtk.c index 10bac94..d1230a6 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -869,7 +869,9 @@ static GSList *gd_vc_init(GtkDisplayState *s, VirtualConsole *vc, int index, GSL const char *label; char buffer[32]; char path[32]; +#if VTE_CHECK_VERSION(0, 26, 0) VtePty *pty; +#endif GIOChannel *chan; GtkWidget *scrolled_window; GtkAdjustment *vadjustment; @@ -902,9 +904,12 @@ static GSList *gd_vc_init(GtkDisplayState *s, VirtualConsole *vc, int index, GSL cfmakeraw(&tty); tcsetattr(slave_fd, TCSAFLUSH, &tty); +#if VTE_CHECK_VERSION(0, 26, 0) pty = vte_pty_new_foreign(master_fd, NULL); - 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);