summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@nokia.com>2009-09-10 15:55:08 +0200
committerJoerg Bornemann <joerg.bornemann@nokia.com>2009-09-10 15:58:22 +0200
commit53e1c8983b0093ce2b63f90eaee856f57961c00f (patch)
tree3b086675a7a2556fc1791879e24dc3c57f5d42df /src
parentcc59689e4a09349b7475426bf98f4c0839f6ba6a (diff)
restoring a minimized window on Windows CE didn't work
After restoring a minimized window we only saw the window decoration. All content was missing. That's because we don't get a WM_SIZE message for restoring the window. We must react on WM_ACTIVATE in this case. This fixes the issue for Windows mobile too. Task-number: 260702 Reviewed-by: thartman
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qapplication_win.cpp8
-rw-r--r--src/gui/kernel/qguifunctions_wince.cpp9
2 files changed, 12 insertions, 5 deletions
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index d7d079cc62..1babb695e2 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -2084,8 +2084,12 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
// where it got it from; it would simply get a 0 value as the old focus widget.
#ifdef Q_OS_WINCE
{
- if (widget->windowState() & Qt::WindowMinimized)
- widget->dataPtr()->window_state &= ~Qt::WindowMinimized;
+ if (widget->windowState() & Qt::WindowMinimized) {
+ if (widget->windowState() & Qt::WindowMaximized)
+ widget->showMaximized();
+ else
+ widget->show();
+ }
#else
if (!(widget->windowState() & Qt::WindowMinimized)) {
#endif
diff --git a/src/gui/kernel/qguifunctions_wince.cpp b/src/gui/kernel/qguifunctions_wince.cpp
index 6d6aec8470..4bfc14bb0f 100644
--- a/src/gui/kernel/qguifunctions_wince.cpp
+++ b/src/gui/kernel/qguifunctions_wince.cpp
@@ -314,8 +314,8 @@ void qt_wince_maximize(QWidget *widget)
}
}
-void qt_wince_minimize(HWND hwnd) {
-
+void qt_wince_minimize(HWND hwnd)
+{
uint exstyle = GetWindowLongW(hwnd, GWL_EXSTYLE);
uint style = GetWindowLongW(hwnd, GWL_STYLE);
RECT rect;
@@ -324,10 +324,13 @@ void qt_wince_minimize(HWND hwnd) {
AdjustWindowRectEx(&crect, style & ~WS_OVERLAPPED, FALSE, exstyle);
MoveWindow(hwnd, rect.left - crect.left, rect.top - crect.top, 0, 0, true);
SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong (hwnd, GWL_EXSTYLE) | WS_EX_NODRAG);
+#ifdef Q_OS_WINCE_WM
ShowWindow(hwnd, SW_HIDE);
+#else
+ ShowWindow(hwnd, SW_MINIMIZE);
+#endif
}
-
void qt_wince_hide_taskbar(HWND hwnd) {
if (ptrAygFullScreen)
ptrAygFullScreen(hwnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON | SHFS_HIDESTARTICON);