1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-03 04:22:47 -05:00

GTK: fix the exit(1) response to startup-time font errors.

For gtkapp-based tools that will have to stop being a program-fatal
error, so I've turned it into a function called window_setup_error
(which I could in principle reuse for other problems in the long and
tortuous progress of new_session_window), and kept the original
handling in gtkmain.c's implementation of that function while gtkapp.c
does something more sensible with a message box.
This commit is contained in:
Simon Tatham
2017-11-27 20:09:54 +00:00
parent ba55b228a3
commit 4b8baed84a
4 changed files with 32 additions and 7 deletions

View File

@ -4639,17 +4639,21 @@ void new_session_window(Conf *conf, const char *geometry_string)
inst->area = gtk_drawing_area_new();
gtk_widget_set_name(GTK_WIDGET(inst->area), "drawing-area");
{
char *errmsg = setup_fonts_ucs(inst);
if (errmsg) {
window_setup_error(errmsg);
sfree(errmsg);
gtk_widget_destroy(inst->area);
sfree(inst);
return;
}
}
#if GTK_CHECK_VERSION(2,0,0)
inst->imc = gtk_im_multicontext_new();
#endif
{
char *errmsg = setup_fonts_ucs(inst);
if (errmsg) {
fprintf(stderr, "%s: %s\n", appname, errmsg);
exit(1);
}
}
inst->window = make_gtk_toplevel_window(inst);
gtk_widget_set_name(GTK_WIDGET(inst->window), "top-level");
{