summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_win.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2011-04-19 13:55:10 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2011-04-19 13:55:10 (GMT)
commitf540574b44aa874af22ce8b15598b854f28517d7 (patch)
tree6e7b375107fdfeee54516ebc0cd52837a32035eb /src/gui/kernel/qapplication_win.cpp
parent364ce5b7f5379499562b4f4f5a68da7ba068fe1e (diff)
parent8485052e3991aebf7c823b3e80fc06ccf9f08991 (diff)
downloadQt-f540574b44aa874af22ce8b15598b854f28517d7.zip
Qt-f540574b44aa874af22ce8b15598b854f28517d7.tar.gz
Qt-f540574b44aa874af22ce8b15598b854f28517d7.tar.bz2
Merge branch 'master-upstream'
Diffstat (limited to 'src/gui/kernel/qapplication_win.cpp')
-rw-r--r--src/gui/kernel/qapplication_win.cpp34
1 files changed, 25 insertions, 9 deletions
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 349323e..6658300 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -3820,16 +3820,32 @@ bool QETWidget::translateConfigEvent(const MSG &msg)
QApplication::sendSpontaneousEvent(this, &e);
hideChildren(true);
}
- } else if (msg.wParam != SIZE_MINIMIZED && isMinimized()) {
+ } else if (msg.wParam != SIZE_MINIMIZED) {
+ bool window_state_changed = false;
+ Qt::WindowStates oldstate = Qt::WindowStates(dataPtr()->window_state);
+ if (isMinimized()) {
#ifndef Q_WS_WINCE
- const QString title = windowTitle();
- if (!title.isEmpty())
- d_func()->setWindowTitle_helper(title);
+ const QString title = windowTitle();
+ if (!title.isEmpty())
+ d_func()->setWindowTitle_helper(title);
#endif
- data->window_state &= ~Qt::WindowMinimized;
- showChildren(true);
- QShowEvent e;
- QApplication::sendSpontaneousEvent(this, &e);
+ data->window_state &= ~Qt::WindowMinimized;
+ showChildren(true);
+ QShowEvent e;
+ QApplication::sendSpontaneousEvent(this, &e);
+ // Capture SIZE_MAXIMIZED and SIZE_RESTORED without preceding WM_SYSCOMMAND
+ // (Aero Snap on Win7)
+ } else if (msg.wParam == SIZE_MAXIMIZED && !isMaximized()) {
+ data->window_state |= Qt::WindowMaximized;
+ window_state_changed = true;
+ } else if (msg.wParam == SIZE_RESTORED && isMaximized()) {
+ data->window_state &= ~(Qt::WindowMaximized);
+ window_state_changed = true;
+ }
+ if (window_state_changed) {
+ QWindowStateChangeEvent e(oldstate);
+ QApplication::sendSpontaneousEvent(this, &e);
+ }
}
}
if (msg.wParam != SIZE_MINIMIZED && oldSize != newSize) {
@@ -3861,7 +3877,7 @@ bool QETWidget::translateConfigEvent(const MSG &msg)
QApplication::postEvent(this, e);
}
}
-} else if (msg.message == WM_MOVE) { // move event
+ } else if (msg.message == WM_MOVE) { // move event
int a = (int) (short) LOWORD(msg.lParam);
int b = (int) (short) HIWORD(msg.lParam);
QPoint oldPos = geometry().topLeft();