mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-22 21:45:03 -05:00
Centralise drag-select check into term_out().
This tiny refactoring replaces three identical checks at call sites, not all as well commented as each other, with a check in just one place with the best of the three comments.
This commit is contained in:
parent
8c63125f7a
commit
8f365e39f3
@ -3622,6 +3622,13 @@ static void term_out(Terminal *term)
|
|||||||
unsigned char localbuf[256], *chars;
|
unsigned char localbuf[256], *chars;
|
||||||
size_t nchars = 0;
|
size_t nchars = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* During drag-selects, we do not process terminal input, because
|
||||||
|
* the user will want the screen to hold still to be selected.
|
||||||
|
*/
|
||||||
|
if (term->selstate == DRAGGING)
|
||||||
|
return;
|
||||||
|
|
||||||
unget = -1;
|
unget = -1;
|
||||||
|
|
||||||
chars = NULL; /* placate compiler warnings */
|
chars = NULL; /* placate compiler warnings */
|
||||||
@ -7236,7 +7243,6 @@ void term_mouse(Terminal *term, Mouse_Button braw, Mouse_Button bcooked,
|
|||||||
* should make sure to write any pending output if one has just
|
* should make sure to write any pending output if one has just
|
||||||
* finished.
|
* finished.
|
||||||
*/
|
*/
|
||||||
if (term->selstate != DRAGGING)
|
|
||||||
term_out(term);
|
term_out(term);
|
||||||
term_schedule_update(term);
|
term_schedule_update(term);
|
||||||
}
|
}
|
||||||
@ -7550,7 +7556,6 @@ void term_lost_clipboard_ownership(Terminal *term, int clipboard)
|
|||||||
* should make sure to write any pending output if one has just
|
* should make sure to write any pending output if one has just
|
||||||
* finished.
|
* finished.
|
||||||
*/
|
*/
|
||||||
if (term->selstate != DRAGGING)
|
|
||||||
term_out(term);
|
term_out(term);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7559,12 +7564,6 @@ static void term_added_data(Terminal *term)
|
|||||||
if (!term->in_term_out) {
|
if (!term->in_term_out) {
|
||||||
term->in_term_out = true;
|
term->in_term_out = true;
|
||||||
term_reset_cblink(term);
|
term_reset_cblink(term);
|
||||||
/*
|
|
||||||
* During drag-selects, we do not process terminal input,
|
|
||||||
* because the user will want the screen to hold still to
|
|
||||||
* be selected.
|
|
||||||
*/
|
|
||||||
if (term->selstate != DRAGGING)
|
|
||||||
term_out(term);
|
term_out(term);
|
||||||
term->in_term_out = false;
|
term->in_term_out = false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user