mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 09:58:01 +00:00
Ongoing pastes were being abandoned on any key-down event. Quite
apart from the debatable semantic sanity of abandoning mid-paste, this was breaking Shift-paste (theoretically valid in any case, actually necessary with xterm mouse reporting enabled) because when you hold down Shift the window receives a steady stream of KEYDOWN messages as the key auto-repeats. One of those is likely to show up in mid-paste and scupper you. For the moment, this has been changed so that only a key press that actually _generates session data_ aborts a paste. In future I plan to review just why we're doing this anyway (it may be that paste-little-by-little was a response to rubbish socket buffering, in which case we can dispense with it completely now). [originally from svn r1279]
This commit is contained in:
parent
39c3f9b8bc
commit
7466f4785c
20
window.c
20
window.c
@ -2142,6 +2142,14 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
|||||||
return DefWindowProc(hwnd, message, wParam, lParam);
|
return DefWindowProc(hwnd, message, wParam, lParam);
|
||||||
|
|
||||||
if (len != 0) {
|
if (len != 0) {
|
||||||
|
/*
|
||||||
|
* Interrupt an ongoing paste. I'm not sure
|
||||||
|
* this is sensible, but for the moment it's
|
||||||
|
* preferable to having to faff about buffering
|
||||||
|
* things.
|
||||||
|
*/
|
||||||
|
term_nopaste();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We need not bother about stdin backlogs
|
* We need not bother about stdin backlogs
|
||||||
* here, because in GUI PuTTY we can't do
|
* here, because in GUI PuTTY we can't do
|
||||||
@ -2823,10 +2831,6 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
|
|||||||
seen_key_event = 1;
|
seen_key_event = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure we're not pasting */
|
|
||||||
if (key_down)
|
|
||||||
term_nopaste();
|
|
||||||
|
|
||||||
if (compose_state > 1 && left_alt)
|
if (compose_state > 1 && left_alt)
|
||||||
compose_state = 0;
|
compose_state = 0;
|
||||||
|
|
||||||
@ -3356,6 +3360,14 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
|
|||||||
#endif
|
#endif
|
||||||
if (r > 0) {
|
if (r > 0) {
|
||||||
WCHAR keybuf;
|
WCHAR keybuf;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Interrupt an ongoing paste. I'm not sure this is
|
||||||
|
* sensible, but for the moment it's preferable to
|
||||||
|
* having to faff about buffering things.
|
||||||
|
*/
|
||||||
|
term_nopaste();
|
||||||
|
|
||||||
p = output;
|
p = output;
|
||||||
for (i = 0; i < r; i++) {
|
for (i = 0; i < r; i++) {
|
||||||
unsigned char ch = (unsigned char) keys[i];
|
unsigned char ch = (unsigned char) keys[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user