Focus tab for quit game dialog (#5670)

This commit is contained in:
lilyhuang-github 2025-03-02 09:29:17 -05:00 committed by GitHub
parent 56bd11794e
commit 3d0f4868df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -506,10 +506,12 @@ void TabGame::actConcede()
bool TabGame::leaveGame()
{
if (!gameClosed) {
if (!spectator)
if (!spectator) {
tabSupervisor->setCurrentWidget(this);
if (QMessageBox::question(this, tr("Leave game"), tr("Are you sure you want to leave this game?"),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No) != QMessageBox::Yes)
return false;
}
if (!replay)
sendGameCommand(Command_LeaveGame());