mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-04 21:12:47 -05:00
Make the configuration dialog non-modal.
Now every call to do_config_box is replaced with a call to create_config_box, which returns immediately having constructed the new GTK window object, and is passed a callback function which it will arrange to be called when the dialog terminates (whether by OK or by Cancel). That callback is now what triggers the construction of a session window after 'Open' is pressed in the initial config box, or the actual mid-session reconfiguration action after 'Apply' is pressed in a Change Settings box. We were already prepared to ignore the re-selection of 'Change Settings' from the context menu of a window that already had a Change Settings box open (and not accidentally create a second config box for the same window); but now we do slightly better, by finding the existing config box and un-minimising and raising it, in case the user had forgotten it was there. That's a useful featurelet, but not the main purpose of this change. The mani point, of course, is that now the multi-window GtkApplication based front ends now don't do anything confusing to the nesting of gtk_main() when config boxes are involved. Whether you're changing the settings of one (or more than one) of your already-running sessions, preparing to start up a new PuTTY connection, or both at once, we stay in the same top-level instance of gtk_main() and all sessions' top- level callbacks continue to run sensibly.
This commit is contained in:
@ -10,6 +10,8 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
#define MAY_REFER_TO_GTK_IN_HEADERS
|
||||
|
||||
#include "putty.h"
|
||||
#include "storage.h"
|
||||
|
||||
@ -42,12 +44,11 @@ Backend *select_backend(Conf *conf)
|
||||
return back;
|
||||
}
|
||||
|
||||
int cfgbox(Conf *conf)
|
||||
void initial_config_box(Conf *conf, post_dialog_fn_t after, void *afterctx)
|
||||
{
|
||||
char *title = dupcat(appname, " Configuration", NULL);
|
||||
int ret = do_config_box(title, conf, 0, 0);
|
||||
create_config_box(title, conf, FALSE, 0, after, afterctx);
|
||||
sfree(title);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int got_host = 0;
|
||||
|
Reference in New Issue
Block a user