From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34272 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PitRz-0003HW-IB for qemu-devel@nongnu.org; Fri, 28 Jan 2011 13:53:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PitRx-0004hB-ER for qemu-devel@nongnu.org; Fri, 28 Jan 2011 13:53:39 -0500 Received: from moutng.kundenserver.de ([212.227.17.9]:54328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PitRx-0004f4-1G for qemu-devel@nongnu.org; Fri, 28 Jan 2011 13:53:37 -0500 From: Stefan Weil Date: Fri, 28 Jan 2011 19:53:25 +0100 Message-Id: <1296240805-6264-1-git-send-email-weil@mail.berlios.de> In-Reply-To: <4D41E130.2070507@mail.berlios.de> References: <4D41E130.2070507@mail.berlios.de> Subject: [Qemu-devel] [PATCH v2] ui: Load QEMU icon from SDL user interface List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers Cc: Anthony Liguori 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 Signed-off-by: Stefan Weil --- 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