]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
ui: fix icon display for GTK frontend under GNOME Shell with Wayland
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 10 Jan 2019 12:00:46 +0000 (12:00 +0000)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 21 Jan 2019 08:43:13 +0000 (09:43 +0100)
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é <berrange@redhat.com>
Message-id: 20190110120047.25369-3-berrange@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Makefile
configure
ui/gtk.c
ui/qemu.desktop [new file with mode: 0644]

index e4218d11927a4f742d12ca1d6db8398dfa69cc78..e944f77eaec86cd5063461dec9cdd1da840d9b29 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -752,6 +752,9 @@ endif
        mkdir -p "$(DESTDIR)/$(qemu_icondir)/hicolor/scalable/apps"; \
        $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu.svg \
                "$(DESTDIR)/$(qemu_icondir)/hicolor/scalable/apps/qemu.svg"
+       mkdir -p "$(DESTDIR)/$(qemu_desktopdir)"
+       $(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \
+               "$(DESTDIR)/$(qemu_desktopdir)/qemu.desktop"
 ifdef CONFIG_GTK
        $(MAKE) -C po $@
 endif
index ce54cd2bdc0a716bb321ddb5cb49a8bb64f22b77..7f1426ed0cc1eecb7a38dfb9f5ca07694c9adf72 100755 (executable)
--- 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
index ec63befa16f0868922cffd61ed62c4a2deabdd8f..87c0e33d2a299dd99ef3b8ea7478d7ca004101bb 100644 (file)
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2226,6 +2226,7 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts)
 
     theme = gtk_icon_theme_get_default();
     gtk_icon_theme_prepend_search_path(theme, CONFIG_QEMU_ICONDIR);
+    g_set_prgname("qemu");
 
     s->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
     s->vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
diff --git a/ui/qemu.desktop b/ui/qemu.desktop
new file mode 100644 (file)
index 0000000..20f09f5
--- /dev/null
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Version=1.0
+Name=QEMU
+Icon=qemu
+Type=Application
+Terminal=false
+Keywords=Emulators;Virtualization;KVM;
+NoDisplay=true