ui: fix icon display for GTK frontend under GNOME Shell with Wayland

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>
This commit is contained in:
Daniel P. Berrangé 2019-01-10 12:00:46 +00:00 committed by Gerd Hoffmann
parent a8260d3876
commit 67ea954682
4 changed files with 14 additions and 0 deletions

View file

@ -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);

8
ui/qemu.desktop Normal file
View file

@ -0,0 +1,8 @@
[Desktop Entry]
Version=1.0
Name=QEMU
Icon=qemu
Type=Application
Terminal=false
Keywords=Emulators;Virtualization;KVM;
NoDisplay=true