diff --git a/cockatrice/src/tab_supervisor.cpp b/cockatrice/src/tab_supervisor.cpp index 015d9267..32f0ea23 100644 --- a/cockatrice/src/tab_supervisor.cpp +++ b/cockatrice/src/tab_supervisor.cpp @@ -437,7 +437,7 @@ TabMessage *TabSupervisor::addMessageTab(const QString &receiverName, bool focus } void TabSupervisor::maximizeMainWindow() { - emit maximize(); + emit showWindowIfHidden(); } void TabSupervisor::talkLeft(TabMessage *tab) diff --git a/cockatrice/src/tab_supervisor.h b/cockatrice/src/tab_supervisor.h index 13722032..91fc14dd 100644 --- a/cockatrice/src/tab_supervisor.h +++ b/cockatrice/src/tab_supervisor.h @@ -81,7 +81,7 @@ signals: void setMenu(const QList &newMenuList = QList()); void localGameEnded(); void adminLockChanged(bool lock); - void maximize(); + void showWindowIfHidden(); public slots: TabDeckEditor *addDeckEditorTab(const DeckLoader *deckToOpen); void openReplay(GameReplay *replay); diff --git a/cockatrice/src/window_main.cpp b/cockatrice/src/window_main.cpp index 58c4bcfc..3580f906 100644 --- a/cockatrice/src/window_main.cpp +++ b/cockatrice/src/window_main.cpp @@ -599,7 +599,7 @@ MainWindow::MainWindow(QWidget *parent) tabSupervisor = new TabSupervisor(client); connect(tabSupervisor, SIGNAL(setMenu(QList)), this, SLOT(updateTabMenu(QList))); connect(tabSupervisor, SIGNAL(localGameEnded()), this, SLOT(localGameEnded())); - connect(tabSupervisor, SIGNAL(maximize()), this, SLOT(maximize())); + connect(tabSupervisor, SIGNAL(showWindowIfHidden()), this, SLOT(showWindowIfHidden())); tabSupervisor->addDeckEditorTab(0); setCentralWidget(tabSupervisor); @@ -703,8 +703,10 @@ void MainWindow::pixmapCacheSizeChanged(int newSizeInMBs) QPixmapCache::setCacheLimit(newSizeInMBs * 1024); } -void MainWindow::maximize() { - showNormal(); +void MainWindow::showWindowIfHidden() { + // keep the previous window state + setWindowState(windowState() & ~Qt::WindowMinimized); + show(); } /* CARD UPDATER */ diff --git a/cockatrice/src/window_main.h b/cockatrice/src/window_main.h index 149f7197..3c7c6ed9 100644 --- a/cockatrice/src/window_main.h +++ b/cockatrice/src/window_main.h @@ -69,7 +69,7 @@ private slots: void iconActivated(QSystemTrayIcon::ActivationReason reason); - void maximize(); + void showWindowIfHidden(); void actCheckCardUpdates(); void cardUpdateError(QProcess::ProcessError err);