mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 09:58:01 +00:00
Fix resize handling when enabling and disabling full-screen mode.
I'm not sure whether I broke this in the recent revamp or whether it was always broken, but: transitions in and out of full-screen mode work by first maximising or restoring the window, which triggers a WM_SIZE, whose handler then fiddles with the window style to disable or re-enable all the furniture, which in turn triggers a recursive WM_SIZE. The trouble is, after returning from the handler for the inner WM_SIZE, the rest of the outer handler runs, and its client area size is now out of date. So I've added a flag which is set when a resize is handled 'properly', so that after returning from the inner WM_SIZE handler the outer one knows not to try to redo badly work that's already been done well. [originally from svn r9056]
This commit is contained in:
parent
af1060856e
commit
0adb957784
@ -1973,6 +1973,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
|||||||
static int ignore_clip = FALSE;
|
static int ignore_clip = FALSE;
|
||||||
static int need_backend_resize = FALSE;
|
static int need_backend_resize = FALSE;
|
||||||
static int fullscr_on_max = FALSE;
|
static int fullscr_on_max = FALSE;
|
||||||
|
static int processed_resize = FALSE;
|
||||||
static UINT last_mousemove = 0;
|
static UINT last_mousemove = 0;
|
||||||
|
|
||||||
switch (message) {
|
switch (message) {
|
||||||
@ -2756,12 +2757,35 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
|||||||
cfg.win_name_always ? window_name : icon_name);
|
cfg.win_name_always ? window_name : icon_name);
|
||||||
if (wParam == SIZE_RESTORED || wParam == SIZE_MAXIMIZED)
|
if (wParam == SIZE_RESTORED || wParam == SIZE_MAXIMIZED)
|
||||||
SetWindowText(hwnd, window_name);
|
SetWindowText(hwnd, window_name);
|
||||||
if (wParam == SIZE_RESTORED)
|
if (wParam == SIZE_RESTORED) {
|
||||||
|
processed_resize = FALSE;
|
||||||
clear_full_screen();
|
clear_full_screen();
|
||||||
|
if (processed_resize) {
|
||||||
|
/*
|
||||||
|
* Inhibit normal processing of this WM_SIZE; a
|
||||||
|
* secondary one was triggered just now by
|
||||||
|
* clear_full_screen which contained the correct
|
||||||
|
* client area size.
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (wParam == SIZE_MAXIMIZED && fullscr_on_max) {
|
if (wParam == SIZE_MAXIMIZED && fullscr_on_max) {
|
||||||
fullscr_on_max = FALSE;
|
fullscr_on_max = FALSE;
|
||||||
|
processed_resize = FALSE;
|
||||||
make_full_screen();
|
make_full_screen();
|
||||||
|
if (processed_resize) {
|
||||||
|
/*
|
||||||
|
* Inhibit normal processing of this WM_SIZE; a
|
||||||
|
* secondary one was triggered just now by
|
||||||
|
* make_full_screen which contained the correct client
|
||||||
|
* area size.
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
processed_resize = TRUE;
|
||||||
|
|
||||||
if (cfg.resize_action == RESIZE_DISABLED) {
|
if (cfg.resize_action == RESIZE_DISABLED) {
|
||||||
/* A resize, well it better be a minimize. */
|
/* A resize, well it better be a minimize. */
|
||||||
|
Loading…
Reference in New Issue
Block a user