diff --git a/Telegram/SourceFiles/dialogs/dialogs_row.cpp b/Telegram/SourceFiles/dialogs/dialogs_row.cpp index b15c657d6e..c5145c368b 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_row.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_row.cpp @@ -431,15 +431,19 @@ void Row::paintUserpic( auto key = peer->userpicUniqueKey(userpicView()); key.first += peer->messagesTTL(); const auto frameIndex = videoUserpic ? videoUserpic->frameIndex() : -1; - if (_cornerBadgeUserpic->key != key) { + const auto paletteVersion = style::PaletteVersion(); + const auto keyChanged = (_cornerBadgeUserpic->key != key) + || (_cornerBadgeUserpic->paletteVersion != paletteVersion); + if (keyChanged) { _cornerBadgeUserpic->cacheTTL = QImage(); } - if (!_cornerBadgeUserpic->layersManager.isFinished() - || _cornerBadgeUserpic->key != key + if (keyChanged + || !_cornerBadgeUserpic->layersManager.isFinished() || _cornerBadgeUserpic->active != context.active || _cornerBadgeUserpic->frameIndex != frameIndex || videoUserpic) { _cornerBadgeUserpic->key = key; + _cornerBadgeUserpic->paletteVersion = paletteVersion; _cornerBadgeUserpic->active = context.active; _cornerBadgeUserpic->frameIndex = frameIndex; _cornerBadgeUserpic->layersManager.markFrameShown(); diff --git a/Telegram/SourceFiles/dialogs/dialogs_row.h b/Telegram/SourceFiles/dialogs/dialogs_row.h index d44667103d..d79c2efdff 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_row.h +++ b/Telegram/SourceFiles/dialogs/dialogs_row.h @@ -167,6 +167,7 @@ private: struct CornerBadgeUserpic { InMemoryKey key; CornerLayersManager layersManager; + int paletteVersion = 0; int frameIndex = -1; bool active = false; QImage frame;