Disabled forced session switching when closing PiP.

Regression was introduced in 7decf68122.
This commit is contained in:
23rd 2021-07-26 18:54:58 +03:00
parent 82165bec5e
commit 7c8b1cd5b1
2 changed files with 4 additions and 4 deletions

View file

@ -3103,7 +3103,7 @@ void OverlayWidget::switchToPip() {
const auto closeAndContinue = [=] { const auto closeAndContinue = [=] {
_showAsPip = false; _showAsPip = false;
show(OpenRequest( show(OpenRequest(
findWindow(), findWindow(false),
document, document,
document->owner().message(msgId), document->owner().message(msgId),
true)); true));
@ -4536,7 +4536,7 @@ void OverlayWidget::applyHideWindowWorkaround() {
} }
} }
Window::SessionController *OverlayWidget::findWindow() const { Window::SessionController *OverlayWidget::findWindow(bool switchTo) const {
if (!_session) { if (!_session) {
return nullptr; return nullptr;
} }
@ -4553,7 +4553,7 @@ Window::SessionController *OverlayWidget::findWindow() const {
const auto &active = _session->windows(); const auto &active = _session->windows();
if (!active.empty()) { if (!active.empty()) {
return active.front(); return active.front();
} else if (window) { } else if (window && switchTo) {
Window::SessionController *controllerPtr = nullptr; Window::SessionController *controllerPtr = nullptr;
window->invokeForSessionController( window->invokeForSessionController(
&_session->account(), &_session->account(),

View file

@ -411,7 +411,7 @@ private:
void applyHideWindowWorkaround(); void applyHideWindowWorkaround();
Window::SessionController *findWindow() const; Window::SessionController *findWindow(bool switchTo = true) const;
bool _opengl = false; bool _opengl = false;
const std::unique_ptr<Ui::RpWidgetWrap> _surface; const std::unique_ptr<Ui::RpWidgetWrap> _surface;