mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-04 10:33:30 +00:00
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:
parent
50a19c5219
commit
fd65a1404c
|
@ -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 *
|
||||
|
|
Loading…
Reference in a new issue