From b39a5083751605e2ba781393b6b8ea69381efdf4 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Tue, 30 Oct 2018 13:30:10 +0100
Subject: [PATCH] Fix background of composition text

The Chromium API has been changed:
https://chromium-review.googlesource.com/c/chromium/src/+/959006/

Task-number: QTBUG-70289
Task-number: QTBUG-71453
Change-Id: Ib20a82bd826d8067aa3eb3bccccda7d8716e20ad
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
---
 src/core/render_widget_host_view_qt.cpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 0bb28bd37..1582cf733 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -1235,13 +1235,12 @@ void RenderWidgetHostViewQt::handleInputMethodEvent(QInputMethodEvent *ev)
                 end = qMax(0, start + end);
             }
 
-            QTextCharFormat format = qvariant_cast<QTextFormat>(attribute.value).toCharFormat();
+            underlines.push_back(ui::ImeTextSpan(ui::ImeTextSpan::Type::kComposition, start, end, ui::ImeTextSpan::Thickness::kThin, SK_ColorTRANSPARENT));
 
-            QColor underlineColor(0, 0, 0, 0);
+            QTextCharFormat format = qvariant_cast<QTextFormat>(attribute.value).toCharFormat();
             if (format.underlineStyle() != QTextCharFormat::NoUnderline)
-                underlineColor = format.underlineColor();
+                underlines.back().underline_color = toSk(format.underlineColor());
 
-            underlines.push_back(ui::ImeTextSpan(ui::ImeTextSpan::Type::kComposition, start, end, ui::ImeTextSpan::Thickness::kThin, toSk(underlineColor), SK_ColorTRANSPARENT));
             break;
         }
         case QInputMethodEvent::Cursor:
-- 
GitLab