From ec6862d31a9d513dc2647679efa8a7bef3710f2e Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Tue, 25 Feb 2025 02:17:06 +0000 Subject: [PATCH] Communicate PiP window margins to the OS --- Telegram/SourceFiles/media/view/media_view_pip.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Telegram/SourceFiles/media/view/media_view_pip.cpp b/Telegram/SourceFiles/media/view/media_view_pip.cpp index e401e25a3..4e1d7c136 100644 --- a/Telegram/SourceFiles/media/view/media_view_pip.cpp +++ b/Telegram/SourceFiles/media/view/media_view_pip.cpp @@ -362,6 +362,7 @@ void PipPanel::init() { ) | rpl::filter(rpl::mappers::_1) | rpl::start_with_next([=] { // Workaround Qt's forced transient parent. Ui::Platform::ClearTransientParent(widget()); + Ui::Platform::SetWindowMargins(widget(), _padding); }, rp()->lifetime()); rp()->screenValue( @@ -878,6 +879,9 @@ void PipPanel::updateDecorations() { _padding = padding; _useTransparency = use; widget()->setAttribute(Qt::WA_OpaquePaintEvent, !_useTransparency); + if (widget()->windowHandle()) { + Ui::Platform::SetWindowMargins(widget(), _padding); + } setGeometry(newGeometry); update(); }