From a8260d3876389eb52ca5c62ed4d80cdb7e025c85 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrangé" Date: Thu, 10 Jan 2019 12:00:45 +0000 Subject: ui: install logo icons to $prefix/share/icons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QEMU currently installs logos to $prefix/share/qemu/ which means no GUI toolkit or applications can find them by default. The accepted standards for desktop applications declare that application logos / icons should be installed under $prefix/share/icons, so use this directory location. Pre-rendered icons are provided at the standard sizes expected for GUI applications, along with the scalable SVG, to ensure maximum portability. The PNGs are rendered from the SVG using inkscape, however, this is not wired up into the default make rules to avoid requiring inkscape as a mandatory tool in build systems / developer workstations. Signed-off-by: Daniel P. Berrangé Message-id: 20190110120047.25369-2-berrange@redhat.com Signed-off-by: Gerd Hoffmann --- ui/sdl2.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'ui/sdl2.c') diff --git a/ui/sdl2.c b/ui/sdl2.c index a10b6e3a08..4c0d5db473 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -762,7 +762,6 @@ static void sdl2_display_early_init(DisplayOptions *o) static void sdl2_display_init(DisplayState *ds, DisplayOptions *o) { uint8_t data = 0; - char *filename; int i; SDL_SysWMinfo info; @@ -837,15 +836,12 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o) } /* Load a 32x32x4 image. White pixels are transparent. */ - filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, "qemu-icon.bmp"); - if (filename) { - SDL_Surface *image = SDL_LoadBMP(filename); - if (image) { - uint32_t colorkey = SDL_MapRGB(image->format, 255, 255, 255); - SDL_SetColorKey(image, SDL_TRUE, colorkey); - SDL_SetWindowIcon(sdl2_console[0].real_window, image); - } - g_free(filename); + SDL_Surface *image = SDL_LoadBMP(CONFIG_QEMU_ICONDIR + "/hicolor/32x32/apps/qemu.bmp"); + if (image) { + uint32_t colorkey = SDL_MapRGB(image->format, 255, 255, 255); + SDL_SetColorKey(image, SDL_TRUE, colorkey); + SDL_SetWindowIcon(sdl2_console[0].real_window, image); } gui_grab = 0; -- cgit 1.4.1