From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQNSm-00047N-RD for qemu-devel@nongnu.org; Thu, 11 Apr 2013 15:47:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQNSZ-0002i1-8y for qemu-devel@nongnu.org; Thu, 11 Apr 2013 15:47:16 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:53176) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQNSY-0002hE-Ti for qemu-devel@nongnu.org; Thu, 11 Apr 2013 15:47:03 -0400 Message-ID: <5167132D.3090803@weilnetz.de> Date: Thu, 11 Apr 2013 21:46:53 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1364653300-26813-1-git-send-email-sw@weilnetz.de> <51655184.9050607@siemens.com> In-Reply-To: <51655184.9050607@siemens.com> Content-Type: multipart/mixed; boundary="------------040604000203050507090104" Subject: Re: [Qemu-devel] [PATCH] ui/gtk: Set QEMU window icon List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Anthony Liguori , qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------040604000203050507090104 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit 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 = { >> void gtk_display_init(DisplayState *ds) >> { >> GtkDisplayState *s = 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 = qemu_find_file(QEMU_FILE_TYPE_BIOS, "qemu-icon.bmp"); >> + if (filename) { >> + GError *error = NULL; >> + GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(filename,&error); >> + 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 I'm afraid that you won't get a transparent background as long as the image format does not support transparency. SDL only accepts BMP files and obviously translates the white background to a transparent one. 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. Stefan 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. --------------040604000203050507090104 Content-Type: image/bmp; name="qemu-icon.bmp" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="qemu-icon.bmp" iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAMFBMVEX///8AAADNwbwDAwNi LyGDdm/HQA35ZRZWVlb29fMrIRsPBgbh4eEcHBwQEBDMg193qJwEAAAAAXRSTlMAQObYZgAA AAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB90ECxMWIQ5kPDAAAAGWSURBVCjPTZFBKARh FMdfpDZx+GxKrcP2bZPFSpu4KOVgnAg15SCSNdyc9B1Jtr7motyUwypqezUHbU5K2nLRFC4O k28Kudh2Dlty5H3fEv/T+/16817fPACTjiB3Df/Cc0fHVf7HVv8R5XDhl2+W7r44GWupyS3F 4FOInVxQXUwbkV2oCspOEGT3zALJ74hfN3JVS+pVCcn7SBSmG5zLXf1FkdMI4W6JBpdnJLwi FyYFe13iNbSgHG6KL3fKwzlIoFwxSxrccjwsQSeWjWhwx3E8/wmGsHxAvE3oLKL/AkMhavGh hUT1Bssh7pMw7GFEQuGpEVJK9KMLGKyHuCEEITX4tVHIxCHaQmzqBlSvXdA6oZBaNjX70Xkv JFJ1hbZbQIqq5UvQlryqh6dGqKjC5gAexmMV2q7mWj5Fr51nZB5dX6m4wrpJtLPkVfzuzkTE 7F7/wmeWvIzt2Volz/QIgAxjyZGxtRFGKZkzPFCVWtXMuswdbnU5aURP81QDVNLEN2r8OWb2 meo9OPmZqldxTjeyHCf9DTFkwVIQzYdCAAAAAElFTkSuQmCC --------------040604000203050507090104--