From a8260d3876389eb52ca5c62ed4d80cdb7e025c85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= 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 --- configure | 2 ++ 1 file changed, 2 insertions(+) (limited to 'configure') diff --git a/configure b/configure index 3eee3fc..ce54cd2 100755 --- a/configure +++ b/configure @@ -5745,6 +5745,7 @@ qemu_confdir=$sysconfdir$confsuffix qemu_moddir=$libdir$confsuffix qemu_datadir=$datadir$confsuffix qemu_localedir="$datadir/locale" +qemu_icondir="$datadir/icons" # We can only support ivshmem if we have eventfd if [ "$eventfd" = "yes" ]; then @@ -6210,6 +6211,7 @@ if test "$mingw32" = "no" ; then fi echo "qemu_helperdir=$libexecdir" >> $config_host_mak echo "qemu_localedir=$qemu_localedir" >> $config_host_mak +echo "qemu_icondir=$qemu_icondir" >> $config_host_mak echo "libs_softmmu=$libs_softmmu" >> $config_host_mak echo "GIT=$git" >> $config_host_mak echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak -- cgit v1.1 From 67ea95468230fd1619235bf54b63c384cb3a9c51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Thu, 10 Jan 2019 12:00:46 +0000 Subject: ui: fix icon display for GTK frontend under GNOME Shell with Wayland MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The icon associated with a GtkWindow is just a hint to window managers and not all of them will honour it. Some will instead want to show the icon listed by the .desktop file. The desktop file is located based on the application ID, which is set using g_set_prgname. QEMU has not historically provided a desktop file or set its app ID, so it got a broken icon in GNOME shell, which is now fixed. Signed-off-by: Daniel P. Berrangé Message-id: 20190110120047.25369-3-berrange@redhat.com Signed-off-by: Gerd Hoffmann --- configure | 2 ++ 1 file changed, 2 insertions(+) (limited to 'configure') diff --git a/configure b/configure index ce54cd2..7f1426e 100755 --- a/configure +++ b/configure @@ -5746,6 +5746,7 @@ qemu_moddir=$libdir$confsuffix qemu_datadir=$datadir$confsuffix qemu_localedir="$datadir/locale" qemu_icondir="$datadir/icons" +qemu_desktopdir="$datadir/applications" # We can only support ivshmem if we have eventfd if [ "$eventfd" = "yes" ]; then @@ -6212,6 +6213,7 @@ fi echo "qemu_helperdir=$libexecdir" >> $config_host_mak echo "qemu_localedir=$qemu_localedir" >> $config_host_mak echo "qemu_icondir=$qemu_icondir" >> $config_host_mak +echo "qemu_desktopdir=$qemu_desktopdir" >> $config_host_mak echo "libs_softmmu=$libs_softmmu" >> $config_host_mak echo "GIT=$git" >> $config_host_mak echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak -- cgit v1.1 From a442fe2f2b2f20e7be0934277e9400b844b11999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Thu, 10 Jan 2019 12:00:47 +0000 Subject: sdl: add support for high resolution window icon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modern desktop environments can render icons at very large sizes, especially with high DPI screens. Providing a 32x32 pixel bitmap is nowhere near sufficient anymore. When displayed in GNOME shell the QEMU icon looks awful, having been scaled up to at least x4 its base size. This is compounded by the fact that the BMP file doesn't do transparency, so while we've removed white pixels, we still have anti-aliased nearly-white pixels which make the logo look appalling on black backgrounds. Loading a high resolution PNG icon addresses both problems, but requires use of the extra SDL2_image library. Signed-off-by: Daniel P. Berrangé Message-id: 20190110120047.25369-4-berrange@redhat.com Signed-off-by: Gerd Hoffmann --- configure | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'configure') diff --git a/configure b/configure index 7f1426e..9bdcedc 100755 --- a/configure +++ b/configure @@ -346,6 +346,7 @@ fdt="" netmap="no" sdl="" sdlabi="" +sdl_image="" virtfs="" mpath="" vnc="yes" @@ -1042,6 +1043,10 @@ for opt do ;; --with-sdlabi=*) sdlabi="$optarg" ;; + --disable-sdl-image) sdl_image="no" + ;; + --enable-sdl-image) sdl_image="yes" + ;; --disable-qom-cast-debug) qom_cast_debug="no" ;; --enable-qom-cast-debug) qom_cast_debug="yes" @@ -1704,6 +1709,7 @@ disabled with --disable-FEATURE, default is enabled if available: gcrypt libgcrypt cryptography support sdl SDL UI --with-sdlabi select preferred SDL ABI 1.2 or 2.0 + sdl_image SDL Image support for icons gtk gtk UI vte vte support for the gtk UI curses curses UI @@ -3002,11 +3008,44 @@ EOF fi # sdl compile test } +sdl_image_probe () +{ + if test "$sdl_image" != "no" ; then + if $pkg_config SDL2_image --exists; then + if test "$static" = "yes"; then + sdl_image_libs=$($pkg_config SDL2_image --libs --static 2>/dev/null) + else + sdl_image_libs=$($pkg_config SDL2_image --libs 2>/dev/null) + fi + sdl_image_cflags=$($pkg_config SDL2_image --cflags 2>/dev/null) + sdl_image=yes + + sdl_cflags="$sdl_cflags $sdl_image_cflags" + sdl_libs="$sdl_libs $sdl_image_libs" + else + if test "$sdl_image" = "yes" ; then + feature_not_found "sdl_image" "Install SDL Image devel" + else + sdl_image=no + fi + fi + fi +} + if test "$sdl" != "no" ; then sdl_probe fi if test "$sdl" = "yes" ; then + sdl_image_probe +else + if test "$sdl_image" = "yes"; then + echo "warning: SDL Image requested, but SDL is not available, disabling" + fi + sdl_image=no +fi + +if test "$sdl" = "yes" ; then cat > $TMPC < #if defined(SDL_VIDEO_DRIVER_X11) @@ -6029,6 +6068,7 @@ if test "$darwin" = "yes" ; then echo "Cocoa support $cocoa" fi echo "SDL support $sdl $(echo_version $sdl $sdlversion)" +echo "SDL image support $sdl_image" echo "GTK support $gtk $(echo_version $gtk $gtk_version)" echo "GTK GL support $gtk_gl" echo "VTE support $vte $(echo_version $vte $vteversion)" @@ -6368,6 +6408,9 @@ if test "$sdl" = "yes" ; then echo "CONFIG_SDLABI=$sdlabi" >> $config_host_mak echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak echo "SDL_LIBS=$sdl_libs" >> $config_host_mak + if test "$sdl_image" = "yes" ; then + echo "CONFIG_SDL_IMAGE=y" >> $config_host_mak + fi fi if test "$cocoa" = "yes" ; then echo "CONFIG_COCOA=y" >> $config_host_mak -- cgit v1.1