summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/coreplugin/windowsupport.cpp4
-rw-r--r--src/plugins/coreplugin/windowsupport.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/coreplugin/windowsupport.cpp b/src/plugins/coreplugin/windowsupport.cpp
index 17bab61bcc..26117ba12f 100644
--- a/src/plugins/coreplugin/windowsupport.cpp
+++ b/src/plugins/coreplugin/windowsupport.cpp
@@ -40,6 +40,7 @@
#include <QEvent>
#include <QMenu>
#include <QWidget>
+#include <QWindowStateChangeEvent>
namespace Core {
namespace Internal {
@@ -111,6 +112,7 @@ bool WindowSupport::eventFilter(QObject *obj, QEvent *event)
m_minimizeAction->setEnabled(!minimized);
m_zoomAction->setEnabled(!minimized);
}
+ m_previousWindowState = static_cast<QWindowStateChangeEvent *>(event)->oldState();
updateFullScreenAction();
} else if (event->type() == QEvent::WindowActivate) {
m_windowList->setActiveWindow(m_window);
@@ -126,7 +128,7 @@ bool WindowSupport::eventFilter(QObject *obj, QEvent *event)
void WindowSupport::toggleFullScreen()
{
if (m_window->isFullScreen()) {
- m_window->setWindowState(m_window->windowState() & ~Qt::WindowFullScreen);
+ m_window->setWindowState(m_previousWindowState & ~Qt::WindowFullScreen);
} else {
m_window->setWindowState(m_window->windowState() | Qt::WindowFullScreen);
}
diff --git a/src/plugins/coreplugin/windowsupport.h b/src/plugins/coreplugin/windowsupport.h
index 5531306fe0..1e640f6edb 100644
--- a/src/plugins/coreplugin/windowsupport.h
+++ b/src/plugins/coreplugin/windowsupport.h
@@ -80,6 +80,7 @@ private:
QAction *m_zoomAction;
QAction *m_closeAction;
QAction *m_toggleFullScreenAction;
+ Qt::WindowStates m_previousWindowState;
bool m_shutdown = false;
};