Skip to content

Commit

Permalink
Restore maximized window
Browse files Browse the repository at this point in the history
  • Loading branch information
hluk committed Jan 16, 2016
1 parent 6de4186 commit 67a1d76
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/gui/mainwindow.cpp
Expand Up @@ -300,6 +300,7 @@ MainWindow::MainWindow(QWidget *parent)
, m_commandDialog(NULL)
, m_canUpdateTitleFromScript(true)
, m_iconSnip(false)
, m_wasMaximized(false)
{
ui->setupUi(this);
menuBar()->setObjectName("menu_bar");
Expand Down Expand Up @@ -1476,6 +1477,8 @@ bool MainWindow::event(QEvent *event)
m_lastWindow.clear();
updateWindowTransparency();
setHideTabs(m_options.hideTabs);
} else if (type == QEvent::Hide) {
m_wasMaximized = isMaximized();
}

return QMainWindow::event(event);
Expand Down Expand Up @@ -1615,7 +1618,10 @@ void MainWindow::showWindow()

updateFocusWindows();

showNormal();
if (m_wasMaximized)
showMaximized();
else
showNormal();
raise();
activateWindow();

Expand Down
2 changes: 2 additions & 0 deletions src/gui/mainwindow.h
Expand Up @@ -590,6 +590,8 @@ private slots:
bool m_canUpdateTitleFromScript;

bool m_iconSnip;

bool m_wasMaximized;
};

#endif // MAINWINDOW_H

0 comments on commit 67a1d76

Please sign in to comment.