Fix viewer hide workaround for software renderer.

This commit is contained in:
John Preston 2024-01-02 12:59:41 +04:00
parent c51a8816eb
commit e2e55312b8
2 changed files with 12 additions and 0 deletions

View file

@ -20,10 +20,21 @@ OverlayWidget::RendererSW::RendererSW(not_null<OverlayWidget*> owner)
, _transparentBrush(style::TransparentPlaceholder()) {
}
bool OverlayWidget::RendererSW::handleHideWorkaround() {
// This is needed on Windows or Linux,
// because on reopen it blinks with the last shown content.
return _owner->_hideWorkaround != nullptr;
}
void OverlayWidget::RendererSW::paintFallback(
Painter &&p,
const QRegion &clip,
Ui::GL::Backend backend) {
if (handleHideWorkaround()) {
p.setCompositionMode(QPainter::CompositionMode_Source);
p.fillRect(clip.boundingRect(), Qt::transparent);
return;
}
_p = &p;
_clip = &clip;
_clipOuter = clip.boundingRect();

View file

@ -59,6 +59,7 @@ private:
QRect rect,
float64 opacity = 1.) override;
bool handleHideWorkaround();
void validateOverControlImage();
[[nodiscard]] static QRect TransformRect(QRectF geometry, int rotation);