Communicate PiP window margins to the OS

This commit is contained in:
Ilya Fedin 2025-02-25 02:17:06 +00:00 committed by John Preston
parent 6f23010382
commit ec6862d31a

View file

@ -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();
}