1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Gtk: handle WM close on About box.

Previously this would prevent the About box ever being opened again.
This commit is contained in:
Jacob Nevins 2021-04-05 17:50:02 +01:00
parent 42e43376fc
commit 70a31df9f1

View File

@ -3755,6 +3755,11 @@ void nonfatal(const char *p, ...)
static GtkWidget *aboutbox = NULL;
static void about_window_destroyed(GtkWidget *widget, gpointer data)
{
aboutbox = NULL;
}
static void about_close_clicked(GtkButton *button, gpointer data)
{
gtk_widget_destroy(aboutbox);
@ -3800,6 +3805,9 @@ void about_box(void *window)
gtk_window_set_title(GTK_WINDOW(aboutbox), title);
sfree(title);
g_signal_connect(G_OBJECT(aboutbox), "destroy",
G_CALLBACK(about_window_destroyed), NULL);
w = gtk_button_new_with_label("Close");
gtk_widget_set_can_default(w, true);
gtk_window_set_default(GTK_WINDOW(aboutbox), w);