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>
This commit is contained in:
Daniel P. Berrangé 2019-01-10 12:00:45 +00:00 committed by Gerd Hoffmann
parent 681d61362d
commit a8260d3876
16 changed files with 38 additions and 23 deletions

View file

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