Instead of having a special GTK idle function for dealing with session
closing, I now use the new top-level callback mechanism which is
slightly simpler for calling a one-off function.
Also in this commit, I've arranged for connection_fatal to queue a
call to the same session close function after displaying the message
box, with the effect that now all the same processing takes place no
matter whether the session closes cleanly or uncleanly - e.g. the SSH
specials submenu is cleaned out, as it should be.
git-svn-id: http://svn.tartarus.org/sgt/putty@10022
cda61777-01e9-0310-a592-
d414129be87e
int ignore_sbar;
int mouseptr_visible;
int busy_status;
int ignore_sbar;
int mouseptr_visible;
int busy_status;
- guint term_exit_idle_id;
guint toplevel_callback_idle_id;
int alt_keycode;
int alt_digits;
guint toplevel_callback_idle_id;
int alt_keycode;
int alt_digits;
static char *app_name = "pterm";
static void start_backend(struct gui_data *inst);
static char *app_name = "pterm";
static void start_backend(struct gui_data *inst);
+static void exit_callback(void *vinst);
char *x_get_default(const char *key)
{
char *x_get_default(const char *key)
{
va_start(ap, p);
msg = dupvprintf(p, ap);
va_end(ap);
va_start(ap, p);
msg = dupvprintf(p, ap);
va_end(ap);
fatal_message_box(inst->window, msg);
sfree(msg);
fatal_message_box(inst->window, msg);
sfree(msg);
- if (conf_get_int(inst->conf, CONF_close_on_exit) == FORCE_ON)
- cleanup_exit(1);
+
+ queue_toplevel_callback(exit_callback, inst);
-static gint idle_exit_func(gpointer data)
+static void exit_callback(void *vinst)
- struct gui_data *inst = (struct gui_data *)data;
+ struct gui_data *inst = (struct gui_data *)vinst;
int exitcode, close_on_exit;
if (!inst->exited &&
int exitcode, close_on_exit;
if (!inst->exited &&
update_specials_menu(inst);
gtk_widget_set_sensitive(inst->restartitem, TRUE);
}
update_specials_menu(inst);
gtk_widget_set_sensitive(inst->restartitem, TRUE);
}
-
- gtk_idle_remove(inst->term_exit_idle_id);
- return TRUE;
}
void notify_remote_exit(void *frontend)
{
struct gui_data *inst = (struct gui_data *)frontend;
}
void notify_remote_exit(void *frontend)
{
struct gui_data *inst = (struct gui_data *)frontend;
- inst->term_exit_idle_id = gtk_idle_add(idle_exit_func, inst);
+ queue_toplevel_callback(exit_callback, inst);
}
static gint idle_toplevel_callback_func(gpointer data)
}
static gint idle_toplevel_callback_func(gpointer data)