summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2010-03-12 06:38:42 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2010-03-12 07:24:56 (GMT)
commit72ac56cd49c3c50b8b293b0f9843bafa8e197fcd (patch)
tree2f2ec13bde5306fc1bdd14bec3a182d411f06033
parent76bbc26d9d510570002baee91352f71a6dd46832 (diff)
downloadQt-72ac56cd49c3c50b8b293b0f9843bafa8e197fcd.zip
Qt-72ac56cd49c3c50b8b293b0f9843bafa8e197fcd.tar.gz
Qt-72ac56cd49c3c50b8b293b0f9843bafa8e197fcd.tar.bz2
HotFix for fluidlauncher default size caused by 6d44dadd.
It seems that in Symbian we cannot restore Qt::WA_Moved and Qt::WA_Resized attributes in setWindowState method to the same ones what the attributes were when method was called. Thus we currently make sure that Qt::WA_Moved and Qt::WA_Resized attributes are not touched when normal window state is applied. There is a new task QTBUG-8977 to sort out when those attributes should be set and when not. Reviewed-By: Sami Merila
-rw-r--r--src/gui/kernel/qwidget_s60.cpp21
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp4
2 files changed, 21 insertions, 4 deletions
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 81c4198..79702af 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -1037,6 +1037,17 @@ QPoint QWidget::mapFromGlobal(const QPoint &pos) const
return widgetPos;
}
+static Qt::WindowStates effectiveState(Qt::WindowStates state)
+{
+ if (state & Qt::WindowMinimized)
+ return Qt::WindowMinimized;
+ else if (state & Qt::WindowFullScreen)
+ return Qt::WindowFullScreen;
+ else if (state & Qt::WindowMaximized)
+ return Qt::WindowMaximized;
+ return Qt::WindowNoState;
+}
+
void QWidget::setWindowState(Qt::WindowStates newstate)
{
Q_D(QWidget);
@@ -1108,8 +1119,14 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
//restore normal geometry
top->normalGeometry = normalGeometry;
- setAttribute(Qt::WA_Resized, wasResized);
- setAttribute(Qt::WA_Moved, wasMoved);
+ // FixMe QTBUG-8977
+ // In some platforms, WA_Resized and WA_Moved are also not set when application window state is
+ // anything else than normal. In Symbian we can restore them only for normal window state since
+ // restoring for other modes, will make fluidlauncher to be launched in wrong size (200x100)
+ if (effectiveState(newstate) == Qt::WindowNoState) {
+ setAttribute(Qt::WA_Resized, wasResized);
+ setAttribute(Qt::WA_Moved, wasMoved);
+ }
}
data->window_state = newstate;
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 65f4945..76e20b9 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -10043,8 +10043,8 @@ void tst_QWidget::taskQTBUG_7532_tabOrderWithFocusProxy()
void tst_QWidget::movedAndResizedAttributes()
{
-#if defined (Q_OS_MAC) || defined(Q_WS_QWS)
- QEXPECT_FAIL("", "FixMe, QTBUG-8941", Abort);
+#if defined (Q_OS_MAC) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
+ QEXPECT_FAIL("", "FixMe, QTBUG-8941 and QTBUG-8977", Abort);
QVERIFY(false);
#else
QWidget w;