diff --git a/Telegram/SourceFiles/calls/calls_panel.cpp b/Telegram/SourceFiles/calls/calls_panel.cpp index ea0e5147a..ae2ab2bf8 100644 --- a/Telegram/SourceFiles/calls/calls_panel.cpp +++ b/Telegram/SourceFiles/calls/calls_panel.cpp @@ -706,7 +706,6 @@ void Panel::paintEvent(QPaintEvent *e) { finishAnimating(); if (!_call || isHidden()) return; } else { - Ui::Platform::StartTranslucentPaint(p, e); p.setOpacity(opacity); PainterHighQualityEnabler hq(p); @@ -719,7 +718,6 @@ void Panel::paintEvent(QPaintEvent *e) { } if (_useTransparency) { - Ui::Platform::StartTranslucentPaint(p, e); p.drawPixmapLeft(0, 0, width(), _cache); } else { p.drawPixmapLeft(_padding.left(), _padding.top(), width(), _userPhoto); diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 10e6f572a..3d8a71a2a 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -2522,6 +2522,9 @@ void OverlayWidget::switchToPip() { closeAndContinue, [=] { _pip = nullptr; }); close(); + if (const auto window = Core::App().activeWindow()) { + window->activate(); + } } void OverlayWidget::playbackToggleFullScreen() { diff --git a/Telegram/SourceFiles/media/view/media_view_pip.cpp b/Telegram/SourceFiles/media/view/media_view_pip.cpp index dec4f5c5d..275336f5b 100644 --- a/Telegram/SourceFiles/media/view/media_view_pip.cpp +++ b/Telegram/SourceFiles/media/view/media_view_pip.cpp @@ -260,11 +260,11 @@ PipPanel::PipPanel( setAttribute(Qt::WA_MacAlwaysShowToolWindow); setAttribute(Qt::WA_NoSystemBackground); setAttribute(Qt::WA_TranslucentBackground); + Ui::Platform::IgnoreAllActivation(this); Ui::Platform::InitOnTopPanel(this); setMouseTracking(true); resize(0, 0); show(); - //Ui::Platform::IgnoreAllActivation(this); } void PipPanel::setAspectRatio(QSize ratio) { @@ -429,12 +429,12 @@ void PipPanel::paintEvent(QPaintEvent *e) { QPainter p(this); if (_useTransparency) { - Ui::Platform::StartTranslucentPaint(p, e); + Ui::Platform::StartTranslucentPaint(p, e->region().rects()); } auto request = FrameRequest(); const auto inner = rect().marginsRemoved(_padding); - request.resize = request.outer = inner.size(); + request.resize = request.outer = inner.size() * style::DevicePixelRatio(); request.corners = RectPart(0) | ((_attached & (RectPart::Left | RectPart::Top)) ? RectPart(0) @@ -728,7 +728,9 @@ void Pip::setupPanel() { ) | rpl::filter([=](not_null e) { return e->type() == QEvent::Close; }) | rpl::start_with_next([=] { - _destroy(); + crl::on_main(&_panel, [=] { + _destroy(); + }); }, _panel.lifetime()); } @@ -786,7 +788,7 @@ void Pip::setupStreaming() { void Pip::paint(QPainter &p, FrameRequest request) { const auto image = videoFrameForDirectPaint(request); - p.drawImage(0, 0, image); + p.drawImage(QRect{ QPoint(), request.outer / style::DevicePixelRatio() }, image); if (_instance.player().ready()) { _instance.markFrameShown(); } diff --git a/Telegram/SourceFiles/ui/widgets/separate_panel.cpp b/Telegram/SourceFiles/ui/widgets/separate_panel.cpp index 77afdb0ff..ea56e2e04 100644 --- a/Telegram/SourceFiles/ui/widgets/separate_panel.cpp +++ b/Telegram/SourceFiles/ui/widgets/separate_panel.cpp @@ -398,7 +398,6 @@ void SeparatePanel::paintEvent(QPaintEvent *e) { finishAnimating(); if (isHidden()) return; } else { - Ui::Platform::StartTranslucentPaint(p, e); p.setOpacity(opacity); PainterHighQualityEnabler hq(p); @@ -419,7 +418,6 @@ void SeparatePanel::paintEvent(QPaintEvent *e) { } if (_useTransparency) { - Ui::Platform::StartTranslucentPaint(p, e); paintShadowBorder(p); } else { paintOpaqueBorder(p); diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 8399f70ea..33ea14969 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 8399f70ea0764ff8ebc4928474c311b6327da802 +Subproject commit 33ea14969edfbe2546726d82925a1a66ae49310e