From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Gerd Hoffmann" <kraxel@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>
Subject: [Qemu-devel] [PATCH v2 2/3] ui: fix icon display for GTK frontend under GNOME Shell with Wayland
Date: Thu, 10 Jan 2019 12:00:46 +0000 [thread overview]
Message-ID: <20190110120047.25369-3-berrange@redhat.com> (raw)
In-Reply-To: <20190110120047.25369-1-berrange@redhat.com>
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>
---
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 6dd82f2eb8..f12e935c46 100644
--- a/Makefile
+++ b/Makefile
@@ -751,6 +751,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 c1e1e05b5a..97918ba09c 100755
--- a/configure
+++ b/configure
@@ -5762,6 +5762,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
@@ -6229,6 +6230,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
next prev parent reply other threads:[~2019-01-10 12:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-10 12:00 [Qemu-devel] [PATCH v2 0/3] Fix & improve icon display on GTK and SDL frontends Daniel P. Berrangé
2019-01-10 12:00 ` [Qemu-devel] [PATCH v2 1/3] ui: install logo icons to $prefix/share/icons Daniel P. Berrangé
2019-01-10 15:00 ` Eric Blake
2019-01-11 5:46 ` Gerd Hoffmann
2019-01-10 12:00 ` Daniel P. Berrangé [this message]
2019-01-10 12:00 ` [Qemu-devel] [PATCH v2 3/3] sdl: add support for high resolution window icon Daniel P. Berrangé
2019-01-11 10:43 ` [Qemu-devel] [PATCH v2 0/3] Fix & improve icon display on GTK and SDL frontends Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190110120047.25369-3-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).