diff --git a/cockatrice/src/client/tabs/tab_game.cpp b/cockatrice/src/client/tabs/tab_game.cpp index acb637b11..1b2dc0327 100644 --- a/cockatrice/src/client/tabs/tab_game.cpp +++ b/cockatrice/src/client/tabs/tab_game.cpp @@ -1751,10 +1751,8 @@ void TabGame::createMessageDock(bool bReplay) connect(messageLayoutDock, SIGNAL(topLevelChanged(bool)), this, SLOT(dockTopLevelChanged(bool))); } -void TabGame::closeEvent(QCloseEvent *event) +void TabGame::hideEvent(QHideEvent *event) { - Q_UNUSED(event); - LayoutsSettings &layouts = SettingsCache::instance().layouts(); if (replay) { layouts.setReplayPlayAreaState(saveState()); @@ -1770,6 +1768,8 @@ void TabGame::closeEvent(QCloseEvent *event) layouts.setGameMessageLayoutSize(messageLayoutDock->size()); layouts.setGamePlayerListSize(playerListDock->size()); } + + Tab::hideEvent(event); } // Method uses to sync docks state with menu items state diff --git a/cockatrice/src/client/tabs/tab_game.h b/cockatrice/src/client/tabs/tab_game.h index eaefac4c2..096998728 100644 --- a/cockatrice/src/client/tabs/tab_game.h +++ b/cockatrice/src/client/tabs/tab_game.h @@ -208,7 +208,7 @@ private slots: void actResetLayout(); void freeDocksSize(); - void closeEvent(QCloseEvent *event) override; + void hideEvent(QHideEvent *event) override; bool eventFilter(QObject *o, QEvent *e) override; void dockVisibleTriggered(); void dockFloatingTriggered(); diff --git a/cockatrice/src/client/tabs/tab_supervisor.cpp b/cockatrice/src/client/tabs/tab_supervisor.cpp index d6278fbec..8ba5d791a 100644 --- a/cockatrice/src/client/tabs/tab_supervisor.cpp +++ b/cockatrice/src/client/tabs/tab_supervisor.cpp @@ -234,6 +234,9 @@ void TabSupervisor::refreshShortcuts() void TabSupervisor::closeEvent(QCloseEvent *event) { + // This will accept the event, which we may then override. + QTabWidget::closeEvent(event); + if (getGameCount()) { if (QMessageBox::question(this, tr("Are you sure?"), tr("There are still open games. Are you sure you want to quit?"),