Fix account activation after window closing.
This commit is contained in:
parent
58cedb796e
commit
5278ed1f41
|
@ -1344,6 +1344,12 @@ void Application::closeWindow(not_null<Window::Controller*> window) {
|
|||
++i;
|
||||
}
|
||||
}
|
||||
const auto account = domain().started()
|
||||
? &domain().active()
|
||||
: nullptr;
|
||||
if (account && !_primaryWindows.contains(account) && _lastActiveWindow) {
|
||||
domain().activate(&_lastActiveWindow->account());
|
||||
}
|
||||
}
|
||||
|
||||
void Application::closeChatFromWindows(not_null<PeerData*> peer) {
|
||||
|
|
|
@ -564,7 +564,7 @@ void SetupAccountsWrap(
|
|||
not_null<Main::Account*> account,
|
||||
Fn<void(Qt::KeyboardModifiers)> callback,
|
||||
bool locked) {
|
||||
const auto active = (account == &Core::App().activeAccount());
|
||||
const auto active = (account == &window->session().account());
|
||||
const auto session = &account->session();
|
||||
const auto user = session->user();
|
||||
|
||||
|
@ -659,8 +659,7 @@ void SetupAccountsWrap(
|
|||
state->menu->popup(QCursor::pos());
|
||||
return;
|
||||
}
|
||||
if (&session->account() == &Core::App().activeAccount()
|
||||
|| state->menu) {
|
||||
if (session == &window->session() || state->menu) {
|
||||
return;
|
||||
}
|
||||
state->menu = base::make_unique_q<Ui::PopupMenu>(
|
||||
|
|
Loading…
Reference in New Issue