mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
Fix palette escape sequences sometimes not working.
If a batch of palette changes were seen in between window updates, only
the last one would take immediate effect.
(cherry-picked from commit 5677da6481
)
This commit is contained in:
parent
8f3a0ea69f
commit
746d87fc6f
22
terminal.c
22
terminal.c
@ -1815,6 +1815,16 @@ static void palette_rebuild(Terminal *term)
|
|||||||
{
|
{
|
||||||
unsigned min_changed = OSC4_NCOLOURS, max_changed = 0;
|
unsigned min_changed = OSC4_NCOLOURS, max_changed = 0;
|
||||||
|
|
||||||
|
if (term->win_palette_pending) {
|
||||||
|
/* Possibly extend existing range. */
|
||||||
|
min_changed = term->win_palette_pending_min;
|
||||||
|
max_changed = term->win_palette_pending_limit - 1;
|
||||||
|
} else {
|
||||||
|
/* Start with empty range. */
|
||||||
|
min_changed = OSC4_NCOLOURS;
|
||||||
|
max_changed = 0;
|
||||||
|
}
|
||||||
|
|
||||||
for (unsigned i = 0; i < OSC4_NCOLOURS; i++) {
|
for (unsigned i = 0; i < OSC4_NCOLOURS; i++) {
|
||||||
rgb new_value;
|
rgb new_value;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
@ -1842,10 +1852,14 @@ static void palette_rebuild(Terminal *term)
|
|||||||
|
|
||||||
if (min_changed <= max_changed) {
|
if (min_changed <= max_changed) {
|
||||||
/*
|
/*
|
||||||
* At least one colour changed, so schedule a redraw event to
|
* At least one colour changed (or we had an update scheduled
|
||||||
* pass the result back to the TermWin. This also requires
|
* already). Schedule a redraw event to pass the result back
|
||||||
* invalidating the rest of the window, because usually all
|
* to the TermWin. This also requires invalidating the rest
|
||||||
* the text will need redrawing in the new colours.
|
* of the window, because usually all the text will need
|
||||||
|
* redrawing in the new colours.
|
||||||
|
* (If there was an update pending and this palette rebuild
|
||||||
|
* didn't actually change anything, we'll harmlessly reinforce
|
||||||
|
* the existing update request.)
|
||||||
*/
|
*/
|
||||||
term->win_palette_pending = true;
|
term->win_palette_pending = true;
|
||||||
term->win_palette_pending_min = min_changed;
|
term->win_palette_pending_min = min_changed;
|
||||||
|
Loading…
Reference in New Issue
Block a user