From patchwork Thu Sep 24 11:13:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dominic Evans X-Patchwork-Id: 34217 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 164D4B7B73 for ; Thu, 24 Sep 2009 21:14:56 +1000 (EST) Received: from localhost ([127.0.0.1]:53829 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqmHl-0008UA-3N for incoming@patchwork.ozlabs.org; Thu, 24 Sep 2009 07:14:53 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqmHH-0008Tv-79 for qemu-devel@nongnu.org; Thu, 24 Sep 2009 07:14:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqmHC-0008Qr-Ds for qemu-devel@nongnu.org; Thu, 24 Sep 2009 07:14:22 -0400 Received: from [199.232.76.173] (port=54737 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqmHC-0008Qk-7M for qemu-devel@nongnu.org; Thu, 24 Sep 2009 07:14:18 -0400 Received: from mail-fx0-f214.google.com ([209.85.220.214]:45553) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MqmHB-0000eJ-Rn for qemu-devel@nongnu.org; Thu, 24 Sep 2009 07:14:18 -0400 Received: by fxm10 with SMTP id 10so1325342fxm.8 for ; Thu, 24 Sep 2009 04:14:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=Z/zoTOf+9JtyKtDBbVFK6TA7QL1gzr3viJT9Lwoc6IM=; b=lMO9/0sWjwvOm+g8dmwpcABPbWhkSmEAEQbhYzez8AL3mgidny3WRy23BlL3d6DN/y y9huFSRXpVPurcZx5J4X8MdmnJleLASBKF26QCJ+X1qGKBSRERmMahTSp72JaEl9KnQq Qw8jmBLnXVzqJKMQoZ4uq9XbKtIRw2ZerlI3k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=K2pvBmdUiZPulmovzpTfovYiFDojStdhCt18JBzDDq6rAPIrnoAAPGDE7hXeNEUYfR 07FXY35yUNM3c5wtPYhppN/DnR1u4qUIa/TZFfVzPU95I9e/Z86WLIp1ZiTTGMNsD7gJ yVtndmxXe0Gx/xuFshIcbt7V1DQoPFs1XMQvY= MIME-Version: 1.0 Received: by 10.239.139.91 with SMTP id s27mr303643hbs.84.1253790856302; Thu, 24 Sep 2009 04:14:16 -0700 (PDT) In-Reply-To: References: <2ca5c65a0909170409n67e97785p31f5d2d58cbe5058@mail.gmail.com> <4AB254FC.6080102@codemonkey.ws> From: Dominic Evans Date: Thu, 24 Sep 2009 12:13:56 +0100 Message-ID: <2ca5c65a0909240413i714044cev35cc1ec39a75fd79@mail.gmail.com> Subject: Re: [Qemu-devel] [PATCH] Set SDL icon_title when using `-name XXX` for proper gnome-panel window list integration To: qemu-devel@nongnu.org X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org qemu: improve sdl title information Include the `-name XXX` commandline param in the gnome-panel window list via icon_title. https://bugs.edge.launchpad.net/ubuntu/+source/qemu-kvm/+bug/423076 Signed-off-by: Dominic Evans --- static void sdl_hide_cursor(void) diff --git a/sdl.c b/sdl.c index de63c7f..42b6f37 100644 --- a/sdl.c +++ b/sdl.c @@ -407,7 +407,8 @@ static void sdl_process_key(SDL_KeyboardEvent *ev) static void sdl_update_caption(void) { - char buf[1024]; + char win_title[1024]; + char icon_title[1024]; const char *status = ""; if (!vm_running) @@ -419,12 +420,15 @@ static void sdl_update_caption(void) status = " - Press Ctrl-Alt-Shift to exit grab"; } - if (qemu_name) - snprintf(buf, sizeof(buf), "QEMU (%s)%s", qemu_name, status); - else - snprintf(buf, sizeof(buf), "QEMU%s", status); + if (qemu_name) { + snprintf(win_title, sizeof(win_title), "QEMU (%s)%s", qemu_name, status); + snprintf(icon_title, sizeof(icon_title), "QEMU (%s)", qemu_name); + } else { + snprintf(win_title, sizeof(win_title), "QEMU%s", status); + snprintf(icon_title, sizeof(icon_title), "QEMU"); + } - SDL_WM_SetCaption(buf, "QEMU"); + SDL_WM_SetCaption(win_title, icon_title); }