summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-01-02 20:15:24 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-01-02 20:15:24 -0800
commit7b5874ead7c9115f8e20025ad29733d9e4293d70 (patch)
treef033ac626902a8ab4a9c88676a392befbcb635a3
parent43530d397bd8d754202d0e97d13c32c1f0685f01 (diff)
downloadsubsurface-7b5874ead7c9115f8e20025ad29733d9e4293d70.tar.gz
Only set the window icon if the icon file exists
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--gtk-gui.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index ddae481b1..ee99f01eb 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;