Delay clearing transient parent until the pip window is really exposed

This commit is contained in:
Ilya Fedin 2024-07-06 00:43:18 +04:00 committed by John Preston
parent 9ca9904732
commit 8d0d9bb0bd

View file

@ -351,10 +351,14 @@ void PipPanel::init() {
widget()->resize(0, 0);
widget()->hide();
rp()->shownValue(
) | rpl::filter([=](bool shown) {
return shown;
}) | rpl::start_with_next([=] {
rpl::merge(
rp()->shownValue() | rpl::to_empty,
rp()->paintRequest() | rpl::to_empty
) | rpl::map([=] {
return widget()->windowHandle()
&& widget()->windowHandle()->isExposed();
}) | rpl::distinct_until_changed(
) | rpl::filter(rpl::mappers::_1) | rpl::start_with_next([=] {
// Workaround Qt's forced transient parent.
Ui::Platform::ClearTransientParent(widget());
}, rp()->lifetime());