mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-05-28 23:34:49 -05:00

There were three separate clauses in the WM_SIZE message handler which potentially called term_size() to resize the actual Terminal object. Two of them (for maximisation and normal non-maximised resizing drags) first checked if an interactive resize was in progress, and if so, instead set the need_backend_resize, to defer the term_size call to the end of the interactive operation. But the third, for _un_-maximising a window, didn't have that check. As a result, if you start with a maximised window, drag its title bar downward from the top of the screen (which unmaximises it), and without letting go, drag it back up again (which maximises it), the effect would be that you'd get one call to term_size in the middle of the drag, and a second at the end. This isn't what I intended, and it can also cause a redraw failure in full-screen applications on the server (such as a terminal-based text editor - I reproduced this with emacs), in which after the second term_size the terminal doesn't manage to redraw itself. Now I've pulled out the common logic that was in two of those three pieces of code (and should have been in all three) into a subroutine wm_size_resize_term, and arranged to call that in all three cases. This fixes the inconsistency, and also fixes the emacs redraw problem in the edge case I describe above.