From e050f3f1f9f0aa8ac6ee73544c432077cd2dcfdc Mon Sep 17 00:00:00 2001 From: Evgeny Date: Mon, 27 Jul 2026 09:13:33 +0300 Subject: [PATCH] fix: waveform repaint via viewport()->update() instead of activeWindow() - Timer now calls s_voiceView->viewport()->update() for correct delegate repaint - s_voiceView captured from option.widget in paint() voice section - Previously activeWindow()->update() didn't reach QListView viewport --- tools/chatgui/src/messagedelegate.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/chatgui/src/messagedelegate.cpp b/tools/chatgui/src/messagedelegate.cpp index 105e13e6..7fefd244 100644 --- a/tools/chatgui/src/messagedelegate.cpp +++ b/tools/chatgui/src/messagedelegate.cpp @@ -32,6 +32,7 @@ struct VoicePlayState { }; static QMap s_voiceStates; static QTimer* s_voiceTimer = nullptr; +static QAbstractItemView* s_voiceView = nullptr; static void ensureVoiceTimer() { if (!s_voiceTimer) { @@ -56,7 +57,7 @@ static void ensureVoiceTimer() { } } if (!anyPlaying) s_voiceTimer->stop(); - if (auto* w = QApplication::activeWindow()) w->update(); + if (s_voiceView) s_voiceView->viewport()->update(); }); } } @@ -603,6 +604,7 @@ void MessageDelegate::paint(QPainter *painter, const QStyleOptionViewItem &optio } if (L.isVoice) { + if (option.widget) s_voiceView = (QAbstractItemView*)option.widget; drawBubble(painter, L, option); if (!L.narrow) drawAvatar(painter, L, index);