1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -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:
Simon Tatham
2017-11-26 11:58:02 +00:00
parent 94a2904ab6
commit 817e4ad2dd
7 changed files with 217 additions and 105 deletions

View File

@ -18,15 +18,16 @@ Backend *select_backend(Conf *conf)
return &pty_backend;
}
int cfgbox(Conf *conf)
void initial_config_box(Conf *conf, post_dialog_fn_t after, void *afterctx)
{
/*
* This is a no-op in pterm, except that we'll ensure the
* protocol is set to -1 to inhibit the useless Connection
* panel in the config box.
* This is a no-op in pterm, except that we'll ensure the protocol
* is set to -1 to inhibit the useless Connection panel in the
* config box. So we do that and then just immediately call the
* post-dialog function with a positive result.
*/
conf_set_int(conf, CONF_protocol, -1);
return 1;
after(afterctx, 1);
}
void cleanup_exit(int code)