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()->resize(0, 0);
widget()->hide(); widget()->hide();
rp()->shownValue( rpl::merge(
) | rpl::filter([=](bool shown) { rp()->shownValue() | rpl::to_empty,
return shown; rp()->paintRequest() | rpl::to_empty
}) | rpl::start_with_next([=] { ) | 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. // Workaround Qt's forced transient parent.
Ui::Platform::ClearTransientParent(widget()); Ui::Platform::ClearTransientParent(widget());
}, rp()->lifetime()); }, rp()->lifetime());