diff options
Diffstat (limited to 'src/gui/kernel/qwidget_s60.cpp')
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 7fb21d2..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); @@ -1052,6 +1063,8 @@ void QWidget::setWindowState(Qt::WindowStates newstate) return; if (isWindow()) { + const bool wasResized = testAttribute(Qt::WA_Resized); + const bool wasMoved = testAttribute(Qt::WA_Moved); QSymbianControl *window = static_cast<QSymbianControl *>(effectiveWinId()); if (window && newstate & Qt::WindowMinimized) { @@ -1090,7 +1103,7 @@ void QWidget::setWindowState(Qt::WindowStates newstate) createWinId(); Q_ASSERT(testAttribute(Qt::WA_WState_Created)); // Ensure the initial size is valid, since we store it as normalGeometry below. - if (!testAttribute(Qt::WA_Resized) && !isVisible()) + if (!wasResized && !isVisible()) adjustSize(); QTLWExtra *top = d->topData(); @@ -1105,6 +1118,15 @@ void QWidget::setWindowState(Qt::WindowStates newstate) //restore normal geometry top->normalGeometry = normalGeometry; + + // 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; |