All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: QEMU Developers <qemu-devel@nongnu.org>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Subject: [Qemu-devel] [PATCH v2] ui: Load QEMU icon from SDL user interface
Date: Fri, 28 Jan 2011 19:53:25 +0100	[thread overview]
Message-ID: <1296240805-6264-1-git-send-email-weil@mail.berlios.de> (raw)
In-Reply-To: <4D41E130.2070507@mail.berlios.de>

Load an optional QEMU icon file. If there is no icon file named
qemu-icon.bmp in QEMU's default search path, QEMU will run with
the usual system default icon.

A matching icon file  will be loaded and used by X Windows managers
or MS Windows while a QEMU instance is running.

SDL requires icon files in 32x32 bmp format.

v2:
The first version of this patch also included qemu-icon.bmp
and rules to handle this file. That part will now be published
in a separate patch as soon as the QEMU community has chosen
a common QEMU icon. The SDL code here is useful to try
different icons.

Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 ui/sdl.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/ui/sdl.c b/ui/sdl.c
index f599d42..37bc7de 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -818,6 +818,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
     uint8_t data = 0;
     DisplayAllocator *da;
     const SDL_VideoInfo *vi;
+    char *filename;
 
 #if defined(__APPLE__)
     /* always use generic keymaps */
@@ -846,6 +847,12 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
     vi = SDL_GetVideoInfo();
     host_format = *(vi->vfmt);
 
+    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, "qemu-icon.bmp");
+    if (filename) {
+        SDL_WM_SetIcon(SDL_LoadBMP(filename), NULL);
+        qemu_free(filename);
+    }
+
     dcl = qemu_mallocz(sizeof(DisplayChangeListener));
     dcl->dpy_update = sdl_update;
     dcl->dpy_resize = sdl_resize;
-- 
1.7.2.3

  reply	other threads:[~2011-01-28 18:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-26 19:18 [Qemu-devel] QEMU icon Stefan Weil
2011-01-26 19:23 ` [Qemu-devel] [PATCH] Add an qemu icon Stefan Weil
2011-01-26 19:29   ` [Qemu-devel] Re: [PATCH] Add a QEMU icon Stefan Weil
2011-01-27  6:24 ` [Qemu-devel] " Mulyadi Santosa
2011-01-27 21:18   ` Stefan Weil
2011-01-28 18:53     ` Stefan Weil [this message]
2011-01-29 12:43       ` [Qemu-devel] [PATCH v2] ui: Load QEMU icon from SDL user interface Andreas Färber
2011-01-29 14:48         ` Stefan Weil
2011-02-16 20:15       ` [Qemu-devel] [PATCH v3] ui/sdl: Load optional QEMU icon Stefan Weil
2011-03-20 12:11         ` [Qemu-devel] " Stefan Weil
2011-04-01 19:54         ` [Qemu-devel] " Aurelien Jarno
2011-01-28 22:07     ` [Qemu-devel] " Blue Swirl
2011-01-28 22:19       ` Alexander Graf
2011-01-28 22:48         ` Stefan Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1296240805-6264-1-git-send-email-weil@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.