simon-git: putty (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sun Jun 30 15:05:16 BST 2019


TL;DR:
  e790adec Don't implicitly load a session if Session pane not active.

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2019-06-30 15:05:16

commit e790adec4addbdbc89338d6f0b2cbaa13bffb4ac
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=e790adec4addbdbc89338d6f0b2cbaa13bffb4ac;hp=be0b7cee83129f361401c9510849c62a62286b77
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Jun 29 17:12:47 2019 +0100

    Don't implicitly load a session if Session pane not active.
    
    If you select an entry in the saved sessions list box, but without
    double-clicking to actually load it, and then you hit OK, the config-
    box code will automatically load it. That just saves one click in a
    common situation.
    
    But in order to load that session, the config-box system first has to
    ask the list-box control _which_ session is selected. On Windows, this
    causes an assertion failure if the user has switched away from the
    Session panel to some other panel of the config box, because when the
    list box isn't on screen, its Windows control object is actually
    destroyed.
    
    I think a sensible answer is that we shouldn't be doing that implicit
    load behaviour in any case if the list box isn't _visible_: silently
    loading and launching a session someone selected a lot of UI actions
    ago wasn't really the point. So now I make that behaviour only happen
    when the list box (i.e. the Session panel) _is_ visible. That should
    prevent the assertion failure on Windows, but the UI effect is cross-
    platform, applying even on GTK where the control objects for invisible
    panels persist and so the assertion failure didn't happen. I think
    it's a reasonable UI change to make globally.
    
    In order to implement it, I've had to invent a new query function so
    that config.c can tell whether a given control is visible. In order to
    do that on GTK, I had to give each control a pointer to the 'selparam'
    structure describing its config-box pane, so that query function could
    check it against the current one - and in order to do _that_, I had to
    first arrange that those 'selparam' structures have stable addresses
    from the moment they're first created, which meant adding a layer of
    indirection so that the array of them in the top-level dlgparam
    structure is now an array of _pointers_ rather than of actual structs.
    (That way, realloc half way through config box creation can't
    invalidate the important pointer values.)

 config.c           |  2 +-
 dialog.h           |  4 +++
 fuzzterm.c         |  1 +
 unix/gtkdlg.c      | 87 +++++++++++++++++++++++++++++++++++-------------------
 windows/winctrls.c | 11 +++++++
 5 files changed, 74 insertions(+), 31 deletions(-)



More information about the tartarus-commits mailing list