diff options
author | Daniel P. Berrangé <berrange@redhat.com> | 2019-01-10 12:00:45 +0000 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-01-21 09:43:13 +0100 |
commit | a8260d3876389eb52ca5c62ed4d80cdb7e025c85 (patch) | |
tree | acf70c8ec9214f7c7560c180fbbc531ad75c830d /ui/gtk.c | |
parent | 681d61362d3f766a00806b89d6581869041f73cb (diff) |
ui: install logo icons to $prefix/share/icons
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é <berrange@redhat.com>
Message-id: 20190110120047.25369-2-berrange@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/gtk.c')
-rw-r--r-- | ui/gtk.c | 17 |
1 files changed, 5 insertions, 12 deletions
@@ -2214,8 +2214,8 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts) VirtualConsole *vc; GtkDisplayState *s = g_malloc0(sizeof(*s)); - char *filename; GdkDisplay *window_display; + GtkIconTheme *theme; if (!gtkinit) { fprintf(stderr, "gtk initialization failed\n"); @@ -2224,6 +2224,9 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts) assert(opts->type == DISPLAY_TYPE_GTK); s->opts = opts; + theme = gtk_icon_theme_get_default(); + gtk_icon_theme_prepend_search_path(theme, CONFIG_QEMU_ICONDIR); + s->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); s->vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); s->notebook = gtk_notebook_new(); @@ -2248,17 +2251,7 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts) qemu_add_mouse_mode_change_notifier(&s->mouse_mode_notifier); qemu_add_vm_change_state_handler(gd_change_runstate, s); - filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, "qemu_logo_no_text.svg"); - if (filename) { - GError *error = NULL; - GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(filename, &error); - if (pixbuf) { - gtk_window_set_icon(GTK_WINDOW(s->window), pixbuf); - } else { - g_error_free(error); - } - g_free(filename); - } + gtk_window_set_icon_name(GTK_WINDOW(s->window), "qemu"); gd_create_menus(s); |