1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

Remove frontend_keypress().

This was used by ldisc to communicate back to the front end that a key
had been pressed (or rather, that a keypress had caused a nonzero
amount of session input data). Its only nontrivial implementation was
in gtkwin.c, which used that notification to implement the Unix GUI's
"close window on keypress, if the session was already over" policy.

(Which in turn is Unix-specific, because the rationale is that
sometimes X servers don't have a functioning window manager, so it's
useful to have a way of telling any application to close without using
WM-provided facilities like a close button.)

But gtkwin.c doesn't need to be told by the ldisc that a keypress
happened - it's the one _sending_ those keypresses to ldisc in the
first place! So I've thrown away the three stub implementations of
frontend_keypress, removed the call to it in ldisc.c, and replaced it
with calls in gtkwin.c at all the points during keypress handling
that call ldisc_send.

A visible effect is that pterm's close-on-keypress behaviour will now
only trigger on an actual (input-generating) _keypress_, and not on
other input generation such as a paste action. I think that's an
improvement.
This commit is contained in:
Simon Tatham
2018-10-11 18:14:05 +01:00
parent e053ea9a2e
commit 109df9f46b
6 changed files with 19 additions and 36 deletions

View File

@ -480,14 +480,6 @@ int console_get_userpass_input(prompts_t *p)
return 1; /* success */
}
void frontend_keypress(Frontend *frontend)
{
/*
* This is nothing but a stub, in console code.
*/
return;
}
static const LogPolicyVtable default_logpolicy_vt = {
console_eventlog,
console_askappend,

View File

@ -5907,17 +5907,6 @@ static void flip_full_screen()
}
}
void frontend_keypress(Frontend *frontend)
{
/*
* Keypress termination in non-Close-On-Exit mode is not
* currently supported in PuTTY proper, because the window
* always has a perfectly good Close button anyway. So we do
* nothing here.
*/
return;
}
int from_backend(Frontend *frontend, int is_stderr, const void *data, int len)
{
return term_data(term, is_stderr, data, len);