mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 15:13:57 +02:00
Fix viewer hide workaround for software renderer.
This commit is contained in:
parent
c51a8816eb
commit
e2e55312b8
2 changed files with 12 additions and 0 deletions
|
@ -20,10 +20,21 @@ OverlayWidget::RendererSW::RendererSW(not_null<OverlayWidget*> owner)
|
||||||
, _transparentBrush(style::TransparentPlaceholder()) {
|
, _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(
|
void OverlayWidget::RendererSW::paintFallback(
|
||||||
Painter &&p,
|
Painter &&p,
|
||||||
const QRegion &clip,
|
const QRegion &clip,
|
||||||
Ui::GL::Backend backend) {
|
Ui::GL::Backend backend) {
|
||||||
|
if (handleHideWorkaround()) {
|
||||||
|
p.setCompositionMode(QPainter::CompositionMode_Source);
|
||||||
|
p.fillRect(clip.boundingRect(), Qt::transparent);
|
||||||
|
return;
|
||||||
|
}
|
||||||
_p = &p;
|
_p = &p;
|
||||||
_clip = &clip;
|
_clip = &clip;
|
||||||
_clipOuter = clip.boundingRect();
|
_clipOuter = clip.boundingRect();
|
||||||
|
|
|
@ -59,6 +59,7 @@ private:
|
||||||
QRect rect,
|
QRect rect,
|
||||||
float64 opacity = 1.) override;
|
float64 opacity = 1.) override;
|
||||||
|
|
||||||
|
bool handleHideWorkaround();
|
||||||
void validateOverControlImage();
|
void validateOverControlImage();
|
||||||
|
|
||||||
[[nodiscard]] static QRect TransformRect(QRectF geometry, int rotation);
|
[[nodiscard]] static QRect TransformRect(QRectF geometry, int rotation);
|
||||||
|
|
Loading…
Add table
Reference in a new issue