Close PiP when a passcode lock is enabled.

This commit is contained in:
John Preston 2023-02-15 10:47:10 +04:00
parent 91e6c42fcf
commit 7557a20679
3 changed files with 9 additions and 2 deletions

View file

@ -1118,10 +1118,11 @@ void Application::updateWindowTitles() {
}
void Application::lockByPasscode() {
_passcodeLock = true;
enumerateWindows([&](not_null<Window::Controller*> w) {
_passcodeLock = true;
w->setupPasscodeLock();
});
hideMediaView();
}
void Application::maybeLockByPasscode() {

View file

@ -194,7 +194,6 @@ void MainWindow::setupPasscodeLock() {
_passcodeLock.create(bodyWidget(), &controller());
updateControlsGeometry();
Core::App().hideMediaView();
ui_hideSettingsAndLayer(anim::type::instant);
if (_main) {
_main->hide();

View file

@ -3380,6 +3380,13 @@ void OverlayWidget::switchToPip() {
}) | rpl::start_with_next([=] {
_pip = nullptr;
}, _pip->lifetime);
Core::App().passcodeLockChanges(
) | rpl::filter(
rpl::mappers::_1
) | rpl::start_with_next([=] {
_pip = nullptr;
}, _pip->lifetime);
}
if (isHidden()) {