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

@ -109,6 +109,7 @@ https://wiki.gnome.org/Projects/GTK%2B/OSX/Bundling has some links.
#define MAY_REFER_TO_GTK_IN_HEADERS
#include "putty.h"
#include "gtkmisc.h"
char *x_get_default(const char *key) { return NULL; }
@ -226,6 +227,19 @@ void new_app_win(GtkApplication *app)
launch_new_session();
}
static void window_setup_error_callback(void *vctx, int result)
{
g_application_release(G_APPLICATION(app));
}
void window_setup_error(const char *errmsg)
{
create_message_box(NULL, "Error creating session window", errmsg,
string_width("Some sort of fiddly error message that "
"might be technical"),
TRUE, &buttons_ok, window_setup_error_callback, NULL);
}
static void activate(GApplication *app,
gpointer user_data)
{