1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-16 03:53:01 -05:00

Fix side-effect of Always On Top patch: any reconfiguring in mid-session

was zapping the window to the top left corner of the screen

[originally from svn r780]
This commit is contained in:
Simon Tatham 2000-10-30 10:39:10 +00:00
parent 21299d2c39
commit a739876719

View File

@ -1156,6 +1156,8 @@ static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
}
break;
case IDM_RECONF:
{
int prev_alwaysontop = cfg.alwaysontop;
if (!do_reconfig(hwnd))
break;
just_reconfigged = TRUE;
@ -1169,7 +1171,10 @@ static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
und_mode = UND_FONT;
init_fonts(0);
sfree(logpal);
/* Telnet will change local echo -> remote if the remote asks */
/*
* Telnet will change local echo -> remote if the
* remote asks.
*/
if (cfg.protocol != PROT_TELNET)
ldisc = (cfg.ldisc_term ? &ldisc_term : &ldisc_simple);
if (pal)
@ -1185,12 +1190,16 @@ static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
LONG nexflag, exflag = GetWindowLong(hwnd, GWL_EXSTYLE);
nexflag = exflag;
if (cfg.alwaysontop != prev_alwaysontop) {
if (cfg.alwaysontop) {
nexflag = WS_EX_TOPMOST;
SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE);
SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE);
} else {
nexflag = 0;
SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE);
SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE);
}
}
nflg = flag;
@ -1234,6 +1243,7 @@ static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
SetWindowText (hwnd,
cfg.win_name_always ? window_name : icon_name);
}
}
break;
case IDM_CLRSB:
term_clrsb();