From b6efff4157dd1176e2763af94555af16a13cbc48 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Tue, 7 Jun 2022 01:08:20 +0200 Subject: [PATCH] Fix Selected text changes color issue when editor window loses focus Fix #11743 --- PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp index e57a5f92b..fb10462ab 100644 --- a/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp @@ -2617,7 +2617,11 @@ void ScintillaEditView::performGlobalStyles() execute(SCI_SETELEMENTCOLOUR, SC_ELEMENT_SELECTION_INACTIVE_BACK, selectColorBack); if (nppParams.isSelectFgColorEnabled()) - execute(SCI_SETSELFORE, 1, selectColorFore); + { + long alphaSelectColorFore = selectColorFore; + alphaSelectColorFore |= 0xFF000000; // add alpha color to make DirectWrite mode work + execute(SCI_SETELEMENTCOLOUR, SC_ELEMENT_SELECTION_INACTIVE_TEXT, alphaSelectColorFore); + } COLORREF caretColor = black; pStyle = stylers.findByID(SCI_SETCARETFORE);