From 34ea6c5b3e1744e56393a3af9d0710026e2290d7 Mon Sep 17 00:00:00 2001 From: vserediuk <65343640+vserediuk@users.noreply.github.com> Date: Thu, 19 Mar 2026 20:46:20 +0100 Subject: [PATCH] Fix excessive combining marks causing GPU overload Extend IsDiacritic() to recognize Mark_Enclosing and Mark_SpacingCombining Unicode categories, so the existing per-character combining mark limit (kMaxDiacAfterSymbol = 2) applies to all types of combining characters. Previously only Mark_NonSpacing was checked, allowing characters like U+20DD (COMBINING ENCLOSING CIRCLE) to bypass the limit and stack hundreds of times on a single base character, causing GPU overload and rendering corruption. --- ui/text/text.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/text/text.cpp b/ui/text/text.cpp index d13b96810..badcd6e66 100644 --- a/ui/text/text.cpp +++ b/ui/text/text.cpp @@ -2011,8 +2011,11 @@ bool IsSpace(QChar ch) { || (ch == QChar::Tabulation); } -bool IsDiacritic(QChar ch) { // diacritic and variation selectors - return (ch.category() == QChar::Mark_NonSpacing) +bool IsDiacritic(QChar ch) { // diacritic, combining and variation selectors + const auto category = ch.category(); + return (category == QChar::Mark_NonSpacing) + || (category == QChar::Mark_Enclosing) + || (category == QChar::Mark_SpacingCombining) || (ch.unicode() == 1652) || (ch.unicode() >= 64606 && ch.unicode() <= 64611); }