UI: Fill audio meter background each update (#9842)

Since the widget is marked as opaque we need to draw each pixel or
else we may end up with unpainted pixels. On Wayland this will
result in artifacts in the audio meter as transparent pixels will
pick up colors from the underlaying desktop instead.
This commit is contained in:
Florian Zwoch 2024-02-09 13:40:54 +01:00 committed by Ryan Foster
parent 50a19c5219
commit fd65a1404c

View file

@ -1417,6 +1417,10 @@ void VolumeMeter::paintEvent(QPaintEvent *event)
QPainter painter(this);
// Paint window background color (as widget is opaque)
QColor background = palette().color(QPalette::ColorRole::Window);
painter.fillRect(event->region().boundingRect(), background);
if (vertical)
height -= METER_PADDING * 2;
@ -1426,11 +1430,6 @@ void VolumeMeter::paintEvent(QPaintEvent *event)
if (needLayoutChange())
doLayout();
// Paint window background color (as widget is opaque)
QColor background =
palette().color(QPalette::ColorRole::Window);
painter.fillRect(widgetRect, background);
if (vertical) {
paintVTicks(painter,
displayNrAudioChannels *