mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
Re-fix retention of window border on maximise.
The fix in commit 31ab5b8e3083d66 was incomplete. It works when you maximise the window by pressing the maximise button in the title bar, but not when you drag the window to the very top of the screen. In the latter case, the resize at the instant of maximisation works right, but then we get a WM_EXITSIZEMOVE when the drag is released, triggering one final resize which ignored the window border again. That was because wm_size_resize_term() was being given a flag on purpose telling it to ignore the border: apparently at some point in the past, ignoring the border for even a normally maximised window (not even full-screen) was done on purpose. But for the reasons in the previous commit, I'm changing that.
This commit is contained in:
parent
b1ae070925
commit
d5d5eefa5f
@ -2201,11 +2201,11 @@ static void free_hdc(WinGuiSeat *wgs, HDC hdc)
|
|||||||
ReleaseDC(wgs->term_hwnd, hdc);
|
ReleaseDC(wgs->term_hwnd, hdc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wm_size_resize_term(WinGuiSeat *wgs, LPARAM lParam, bool border)
|
static void wm_size_resize_term(WinGuiSeat *wgs, LPARAM lParam)
|
||||||
{
|
{
|
||||||
int width = LOWORD(lParam);
|
int width = LOWORD(lParam);
|
||||||
int height = HIWORD(lParam);
|
int height = HIWORD(lParam);
|
||||||
int border_size = border ? conf_get_int(wgs->conf, CONF_window_border) : 0;
|
int border_size = conf_get_int(wgs->conf, CONF_window_border);
|
||||||
|
|
||||||
int w = (width - border_size*2) / wgs->font_width;
|
int w = (width - border_size*2) / wgs->font_width;
|
||||||
int h = (height - border_size*2) / wgs->font_height;
|
int h = (height - border_size*2) / wgs->font_height;
|
||||||
@ -3129,12 +3129,12 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
|||||||
wgs->prev_rows = wgs->term->rows;
|
wgs->prev_rows = wgs->term->rows;
|
||||||
wgs->prev_cols = wgs->term->cols;
|
wgs->prev_cols = wgs->term->cols;
|
||||||
if (resize_action == RESIZE_TERM)
|
if (resize_action == RESIZE_TERM)
|
||||||
wm_size_resize_term(wgs, lParam, false);
|
wm_size_resize_term(wgs, lParam);
|
||||||
reset_window(wgs, 0);
|
reset_window(wgs, 0);
|
||||||
} else if (wParam == SIZE_RESTORED && wgs->was_zoomed) {
|
} else if (wParam == SIZE_RESTORED && wgs->was_zoomed) {
|
||||||
wgs->was_zoomed = false;
|
wgs->was_zoomed = false;
|
||||||
if (resize_action == RESIZE_TERM) {
|
if (resize_action == RESIZE_TERM) {
|
||||||
wm_size_resize_term(wgs, lParam, true);
|
wm_size_resize_term(wgs, lParam);
|
||||||
reset_window(wgs, 2);
|
reset_window(wgs, 2);
|
||||||
} else if (resize_action != RESIZE_FONT)
|
} else if (resize_action != RESIZE_FONT)
|
||||||
reset_window(wgs, 2);
|
reset_window(wgs, 2);
|
||||||
@ -3145,7 +3145,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
|||||||
} else if (resize_action == RESIZE_TERM ||
|
} else if (resize_action == RESIZE_TERM ||
|
||||||
(resize_action == RESIZE_EITHER &&
|
(resize_action == RESIZE_EITHER &&
|
||||||
!is_alt_pressed())) {
|
!is_alt_pressed())) {
|
||||||
wm_size_resize_term(wgs, lParam, true);
|
wm_size_resize_term(wgs, lParam);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sometimes, we can get a spontaneous resize event
|
* Sometimes, we can get a spontaneous resize event
|
||||||
|
Loading…
x
Reference in New Issue
Block a user