qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/3] ui: fix icon display for GTK frontend under GNO


From: Daniel P . Berrangé
Subject: [Qemu-devel] [PATCH 2/3] ui: fix icon display for GTK frontend under GNOME Shell with Wayland
Date: Tue, 18 Dec 2018 14:26:28 +0000

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é <address@hidden>
---
 Makefile        | 3 +++
 configure       | 2 ++
 ui/gtk.c        | 1 +
 ui/qemu.desktop | 8 ++++++++
 4 files changed, 14 insertions(+)
 create mode 100644 ui/qemu.desktop

diff --git a/Makefile b/Makefile
index 300d97cd10..5f896cd4fd 100644
--- a/Makefile
+++ b/Makefile
@@ -748,6 +748,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
diff --git a/configure b/configure
index c47a7be960..96c948166c 100755
--- a/configure
+++ b/configure
@@ -5739,6 +5739,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
@@ -6206,6 +6207,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
diff --git a/ui/gtk.c b/ui/gtk.c
index ec63befa16..87c0e33d2a 100644
--- 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
index 0000000000..20f09f56be
--- /dev/null
+++ b/ui/qemu.desktop
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Version=1.0
+Name=QEMU
+Icon=qemu
+Type=Application
+Terminal=false
+Keywords=Emulators;Virtualization;KVM;
+NoDisplay=true
-- 
2.19.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]