mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Windows: fix resizing of a maximised window.
The RESIZE_EITHER resizing mode responds to a window resize by changing the logical terminal size if the window is shown normally, or by changing the font size to keep the terminal size the same if the resize is a transition between normal and maximised state. But a user pointed out that it's also possible for a window to receive a WM_SIZE message while _remaining_ in maximised state, and that PuTTY's resize logic didn't allow for that possibility. It occurs when there's a change in the amount of available screen space for the window to be maximised _in_: e.g. when the video resolution is reconfigured, or when you reconnect to a Remote Desktop session using a client window of a different size, or even when you toggle the 'Automatically hide the taskbar' option in the Windows taskbar settings. In that situation, the right thing seems to be for PuTTY to continue to go with the policy of changing the font size rather than the logical terminal size. In other words, we prefer to change the font size when the resize is _from_ maximised state, _to_ maximised state, _or both_. That's easily implemented by removing the check of the 'was_zoomed' flag, in the case where we've received a WM_SIZE message with the state SIZE_MAXIMIZED: once we know the transition is _to_ maximised state, it doesn't matter whether or not it was also _from_ it. (But we still set the was_zoomed flag to the most recent maximised status, so that we can recognise transitions _out_ of maximised mode.)
This commit is contained in:
parent
14bef228b0
commit
b60230dbb8
@ -3072,7 +3072,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
width = LOWORD(lParam);
|
||||
height = HIWORD(lParam);
|
||||
|
||||
if (wParam == SIZE_MAXIMIZED && !was_zoomed) {
|
||||
if (wParam == SIZE_MAXIMIZED) {
|
||||
was_zoomed = true;
|
||||
prev_rows = term->rows;
|
||||
prev_cols = term->cols;
|
||||
|
Loading…
Reference in New Issue
Block a user