From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQXtX-0008CI-2g for qemu-devel@nongnu.org; Fri, 12 Apr 2013 02:55:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQXtV-0002kj-Ib for qemu-devel@nongnu.org; Fri, 12 Apr 2013 02:55:35 -0400 Received: from mout.web.de ([212.227.15.4]:51999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQXtV-0002kZ-9h for qemu-devel@nongnu.org; Fri, 12 Apr 2013 02:55:33 -0400 Message-ID: <5167AFDD.9090005@web.de> Date: Fri, 12 Apr 2013 08:55:25 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1364653300-26813-1-git-send-email-sw@weilnetz.de> <51655184.9050607@siemens.com> <5167132D.3090803@weilnetz.de> In-Reply-To: <5167132D.3090803@weilnetz.de> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2BHBGMVRHNCXPQRLBFEFT" Subject: Re: [Qemu-devel] [PATCH] ui/gtk: Set QEMU window icon List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Anthony Liguori , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2BHBGMVRHNCXPQRLBFEFT Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2013-04-11 21:46, Stefan Weil wrote: > Am 10.04.2013 13:48, schrieb Jan Kiszka: >> On 2013-03-30 15:21, Stefan Weil wrote: >>> The QEMU icon which is already used for SDL >>> is now also loaded by GTK. >>> >>> Signed-off-by: Stefan Weil >>> --- >>> ui/gtk.c | 13 +++++++++++++ >>> 1 file changed, 13 insertions(+) >>> >>> diff --git a/ui/gtk.c b/ui/gtk.c >>> index a5a8156..c15023b 100644 >>> --- a/ui/gtk.c >>> +++ b/ui/gtk.c >>> @@ -1363,6 +1363,7 @@ static const DisplayChangeListenerOps dcl_ops =3D= { >>> void gtk_display_init(DisplayState *ds) >>> { >>> GtkDisplayState *s =3D g_malloc0(sizeof(*s)); >>> + char *filename; >>> >>> gtk_init(NULL, NULL); >>> >>> @@ -1394,6 +1395,18 @@ void gtk_display_init(DisplayState *ds) >>> >>> gtk_notebook_append_page(GTK_NOTEBOOK(s->notebook), >>> s->drawing_area, gtk_label_new("VGA")); >>> >>> + filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, "qemu-icon.bmp"= ); >>> + if (filename) { >>> + GError *error =3D NULL; >>> + GdkPixbuf *pixbuf =3D gdk_pixbuf_new_from_file(filename,&err= or); >>> + if (pixbuf) { >>> + gtk_window_set_icon(GTK_WINDOW(s->window), pixbuf); >>> + } else { >>> + g_error_free(error); >>> + } >>> + g_free(filename); >>> + } >>> + >>> gd_create_menus(s); >>> >>> gd_connect_signals(s); >>> >> >> With gtk 2.22 I'm lacking transparency of that icon (it has a white >> background). The icon is fine with SDL. Is that an issue of this >> particular gtk version or actually a general problem with >> gdk_pixbuf_new_from_file? >> >> Jan >=20 > I'm afraid that you won't get a transparent background as long > as the image format does not support transparency. >=20 > SDL only accepts BMP files and obviously translates the white backgroun= d > to a transparent one. >=20 > I could have added a PNG icon for gtk, but did not do so because I > thought that the BMP file looked sufficiently good (better than the > default icon on my Debian hosts). There could be a GUI option > which allows setting an arbitrary icon file. It would allow users > to choose icons with transparency for gtk and also different icons > for multiple QEMU instances. >=20 > Stefan >=20 > PS. Try the appended qemu-icon.bmp. It won't work with SDL, but show > the desired result with gtk because it is not a BMP file, but a PNG > file with transparent background. Then why not use separate icons for both UIs (until SDL is removed)? Jan ------enig2BHBGMVRHNCXPQRLBFEFT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlFnr+AACgkQitSsb3rl5xRfOgCfVwRhtK3sCLgYAu1qjDi0xgNF xKoAoMk5B0WT7J43R+z6CaOow3KoHizF =pLsj -----END PGP SIGNATURE----- ------enig2BHBGMVRHNCXPQRLBFEFT--