From: Dirk Hohndel Date: Tue, 3 Jan 2012 04:15:24 +0000 (-0800) Subject: Only set the window icon if the icon file exists X-Git-Url: http://git.tdb.fi/?p=ext%2Fsubsurface.git;a=commitdiff_plain;h=7b5874ead7c9115f8e20025ad29733d9e4293d70 Only set the window icon if the icon file exists Signed-off-by: Dirk Hohndel --- diff --git a/gtk-gui.c b/gtk-gui.c index ddae481..ee99f01 100644 --- a/gtk-gui.c +++ b/gtk-gui.c @@ -694,8 +694,11 @@ void init_ui(int *argcp, char ***argvp) gtk_window_set_default_icon_name ("subsurface"); } } - if (need_icon) - gtk_window_set_icon_from_file(GTK_WINDOW(win), subsurface_icon_name(), NULL); + if (need_icon) { + const char *icon_name = subsurface_icon_name(); + if (!access(icon_name, R_OK)) + gtk_window_set_icon_from_file(GTK_WINDOW(win), icon_name, NULL); + } g_signal_connect(G_OBJECT(win), "delete-event", G_CALLBACK(on_delete), NULL); g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(on_destroy), NULL); main_window = win;