diff options
author | Peter Maydell | 2019-01-23 18:57:47 +0100 |
---|---|---|
committer | Peter Maydell | 2019-01-23 18:57:47 +0100 |
commit | f6b06fcceef465de0cf2514c9f76fe0192896781 (patch) | |
tree | 9454c773ed95151b361c9402533925039e277daa /ui/sdl2.c | |
parent | Merge remote-tracking branch 'remotes/edgar/tags/edgar/xilinx-next-2019-01-22... (diff) | |
parent | egl-helpers.h: do not depend on X11 Window type, use EGLNativeWindowType (diff) | |
download | qemu-f6b06fcceef465de0cf2514c9f76fe0192896781.tar.gz qemu-f6b06fcceef465de0cf2514c9f76fe0192896781.tar.xz qemu-f6b06fcceef465de0cf2514c9f76fe0192896781.zip |
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20190121-pull-request' into staging
ui: highres logo for sdl and gtk, bugfixes for vnc and egl.
# gpg: Signature made Mon 21 Jan 2019 14:11:39 GMT
# gpg: using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg: aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138
* remotes/kraxel/tags/ui-20190121-pull-request:
egl-helpers.h: do not depend on X11 Window type, use EGLNativeWindowType
vnc: detect and optimize pageflips
sdl: add support for high resolution window icon
ui: fix icon display for GTK frontend under GNOME Shell with Wayland
ui: install logo icons to $prefix/share/icons
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'ui/sdl2.c')
-rw-r--r-- | ui/sdl2.c | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -762,9 +762,9 @@ 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; + SDL_Surface *icon = NULL; assert(o->type == DISPLAY_TYPE_SDL); @@ -836,16 +836,18 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o) #endif } +#ifdef CONFIG_SDL_IMAGE + icon = IMG_Load(CONFIG_QEMU_ICONDIR "/hicolor/128x128/apps/qemu.png"); +#else /* 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); + icon = SDL_LoadBMP(CONFIG_QEMU_ICONDIR "/hicolor/32x32/apps/qemu.bmp"); + if (icon) { + uint32_t colorkey = SDL_MapRGB(icon->format, 255, 255, 255); + SDL_SetColorKey(icon, SDL_TRUE, colorkey); + } +#endif + if (icon) { + SDL_SetWindowIcon(sdl2_console[0].real_window, icon); } gui_grab = 0; |