1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

wm_size_resize_term: update conf unconditionally.

A user reported that when a PuTTY window is resized by the
'FancyZones' tool included in Microsoft PowerToys, the terminal itself
knows the new size ('stty' showed that it had sent a correct SIGWINCH
to the SSH server), but the next invocation of the Change Settings
dialog box still has the old size entered in it, leading to confusing
behaviour when you press Apply.

Inside PuTTY, this must mean that we updated the actual terminal's
size, but didn't update the main Conf object to match it, which is
where Change Settings populates its initial dialog state from.

It looks as if this is because FancyZones resizes the window by
sending it one single WM_SIZE, without wrapping it in the
WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE messages that signal the start
and end of an interactive dragging resize operation. And the update of
Conf in wm_size_resize_term was in only one branch of the if statement
that checks whether we're in an interactive resize. Now it's outside
the if, so Conf will be updated in both cases.
This commit is contained in:
Simon Tatham 2024-12-15 14:48:01 +00:00
parent 11c7c7608c
commit 1fc5f4afd1

View File

@ -2185,12 +2185,12 @@ static void wm_size_resize_term(WinGuiSeat *wgs, LPARAM lParam)
* numbers of resize events. * numbers of resize events.
*/ */
wgs->need_backend_resize = true; wgs->need_backend_resize = true;
conf_set_int(wgs->conf, CONF_height, h);
conf_set_int(wgs->conf, CONF_width, w);
} else { } else {
term_size(wgs->term, h, w, term_size(wgs->term, h, w,
conf_get_int(wgs->conf, CONF_savelines)); conf_get_int(wgs->conf, CONF_savelines));
} }
conf_set_int(wgs->conf, CONF_height, h);
conf_set_int(wgs->conf, CONF_width, w);
} }
static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,