[LyX/2.4.x] Remove alpha component of system colors

Richard Kimberly Heck rikiheck at lyx.org
Mon Jul 22 19:56:36 UTC 2024


commit 2999061e38c5d28d24cdb194f5272a6cbc7baa06
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Mon Jul 22 20:36:20 2024 +0200

    Remove alpha component of system colors
    
    When using system colors it may happen (on windows 11 in particular)
    that the background color is actually translucid. This is not
    something we are prepared to handle and it creates ghosts on screen.
    
    The fix is easy: the alpha channel of the colors is set to 255.
    
    Fixes bug #13084.
    
    (cherry picked from commit 095bb18331f8eb4653691a64520d89d4a2d60fc4)
---
 src/frontends/qt/ColorCache.cpp | 4 +++-
 status.24x                      | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/frontends/qt/ColorCache.cpp b/src/frontends/qt/ColorCache.cpp
index 1c3d68e548..2566b75025 100644
--- a/src/frontends/qt/ColorCache.cpp
+++ b/src/frontends/qt/ColorCache.cpp
@@ -86,7 +86,9 @@ QColor ColorCache::get(Color const & color, bool syscolors) const
 		QPalette::ColorRole const cr = role(color.baseColor);
 		if (syscolors && cr != QPalette::NoRole) {
 			static QColor const white = Qt::white;
-			QColor const c = pal_.brush(QPalette::Active, cr).color();
+			QColor c = pal_.brush(QPalette::Active, cr).color();
+			// Change to fully opaque color
+			c.setAlpha(255);
 			if (cr == QPalette::Base && c == white)
 				return lcolors_[color.baseColor];
 			else
diff --git a/status.24x b/status.24x
index 7e4886fea3..72f4335f60 100644
--- a/status.24x
+++ b/status.24x
@@ -67,6 +67,8 @@ What's new
 - Enable OK/Apply button in tabular dialog when "Additional Space" combo has
   been set to different value.
 
+- Fix ghost image on Windows with system colors (bug 13084).
+
 
 * INTERNALS
 


More information about the lyx-cvs mailing list