mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-16 12:03:03 -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:
parent
21299d2c39
commit
a739876719
16
window.c
16
window.c
@ -1156,6 +1156,8 @@ static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IDM_RECONF:
|
case IDM_RECONF:
|
||||||
|
{
|
||||||
|
int prev_alwaysontop = cfg.alwaysontop;
|
||||||
if (!do_reconfig(hwnd))
|
if (!do_reconfig(hwnd))
|
||||||
break;
|
break;
|
||||||
just_reconfigged = TRUE;
|
just_reconfigged = TRUE;
|
||||||
@ -1169,7 +1171,10 @@ static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
|
|||||||
und_mode = UND_FONT;
|
und_mode = UND_FONT;
|
||||||
init_fonts(0);
|
init_fonts(0);
|
||||||
sfree(logpal);
|
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)
|
if (cfg.protocol != PROT_TELNET)
|
||||||
ldisc = (cfg.ldisc_term ? &ldisc_term : &ldisc_simple);
|
ldisc = (cfg.ldisc_term ? &ldisc_term : &ldisc_simple);
|
||||||
if (pal)
|
if (pal)
|
||||||
@ -1185,12 +1190,16 @@ static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
|
|||||||
LONG nexflag, exflag = GetWindowLong(hwnd, GWL_EXSTYLE);
|
LONG nexflag, exflag = GetWindowLong(hwnd, GWL_EXSTYLE);
|
||||||
|
|
||||||
nexflag = exflag;
|
nexflag = exflag;
|
||||||
|
if (cfg.alwaysontop != prev_alwaysontop) {
|
||||||
if (cfg.alwaysontop) {
|
if (cfg.alwaysontop) {
|
||||||
nexflag = WS_EX_TOPMOST;
|
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 {
|
} else {
|
||||||
nexflag = 0;
|
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;
|
nflg = flag;
|
||||||
@ -1234,6 +1243,7 @@ static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
|
|||||||
SetWindowText (hwnd,
|
SetWindowText (hwnd,
|
||||||
cfg.win_name_always ? window_name : icon_name);
|
cfg.win_name_always ? window_name : icon_name);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case IDM_CLRSB:
|
case IDM_CLRSB:
|
||||||
term_clrsb();
|
term_clrsb();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user