Commit 4cd6ec74 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii Committed by Fushan Wen
Browse files

Make DesktopView set black clear color only on Wayland

745e2c08 made DesktopView set clear
color to "black" so the compositor could avoid overdraw and thus
optimizing rendering. In the perfect world, such a change would create
no regressions, but for some reason, it made panels lose alpha channel
on X11.

That makes absolutely no any sense. DesktopView and PanelView are two
totally different code paths. So changes in DesktopView should not
affect the PanelView. This looks like a QtXCB bug.

Ideally, we should add workarounds only after finding what creates a
problem, but this one is particularly hard because many people who have
tried to reproduce that issue weren't successful. Somebody who can
reproduce the issue would have to be able to build Qt from source code
and add qDebug()s. These requirements are too steep, thus adding a
platform check seems like the best option at the moment.

BUG: 450672
parent 7bc619b9
Pipeline #141398 failed with stage
in 7 minutes and 58 seconds
......@@ -34,7 +34,12 @@ DesktopView::DesktopView(Plasma::Corona *corona, QScreen *targetScreen)
, m_shellSurface(nullptr)
{
QObject::setParent(corona);
setColor(Qt::black);
// Setting clear color to black makes the panel lose alpha channel on X11. This looks like
// a QtXCB bug, so set clear color only on Wayland to let the compositor optimize rendering.
if (KWindowSystem::isPlatformWayland()) {
setColor(Qt::black);
}
if (targetScreen) {
setScreenToFollow(targetScreen);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment