summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2009-09-11 08:13:28 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2009-09-11 08:13:28 (GMT)
commitdacb14e457b40b6839e9f17ec968e95e29113d20 (patch)
tree380423d4f3d3cae9c8e2e628b2931404c6499b78 /src/gui
parentf9243aac1e26ccf9f46cc1d7de5f57063a053211 (diff)
downloadQt-dacb14e457b40b6839e9f17ec968e95e29113d20.zip
Qt-dacb14e457b40b6839e9f17ec968e95e29113d20.tar.gz
Qt-dacb14e457b40b6839e9f17ec968e95e29113d20.tar.bz2
Fixed QWidget::setWindowState for Symbian.
Before this commit calling setWindowState(Qt::WindowFullScreen) on a widget instance affected all new widget instances created after this method. This bug happened due to fact that window decorations i.e. statuspane and softkeys visibility was only changed when switching to or from fullscreen state. In the reported bug it happened that second widget was initially in Qt::WindowNoState and it was changed to Maximized. Since window decorations are global not window specific at the moment, the default decoration visibility for second window is the one to which previous window has set them. In this case previous window was in fullscreen and that's why the decorations were visible also for second maximized window. Probably the right fix would be to change the decoration to window specific but that is quite a big change and for now the bug is fixed with this commit. Autotest: Excluding new test case, same results before and after. Task-number: 261048 Reviewed-by: Jason Barron
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qwidget_s60.cpp43
1 files changed, 27 insertions, 16 deletions
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 94f3532..7509fa5 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -989,6 +989,32 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
return;
if (isWindow()) {
+#ifdef Q_WS_S60
+ // Change window decoration visibility if switching to or from fullsccreen
+ // In addition decoration visibility is changed when the initial has been
+ // WindowNoState.
+ // The window decoration visibility has to be changed before doing actual
+ // window state change since in that order the availableGeometry will return
+ // directly the right size and we will avoid unnecessarty redraws
+ if((oldstate & Qt::WindowFullScreen) != (newstate & Qt::WindowFullScreen) ||
+ oldstate == Qt::WindowNoState) {
+ CEikStatusPane* statusPane = S60->statusPane();
+ CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer();
+ if (newstate & Qt::WindowFullScreen) {
+ if (statusPane)
+ statusPane->MakeVisible(false);
+ if (buttonGroup)
+ buttonGroup->MakeVisible(false);
+ } else {
+ if (statusPane)
+ statusPane->MakeVisible(true);
+ if (buttonGroup)
+ buttonGroup->MakeVisible(true);
+ }
+
+ }
+#endif // Q_WS_S60
+
createWinId();
Q_ASSERT(testAttribute(Qt::WA_WState_Created));
QTLWExtra *top = d->topData();
@@ -1013,30 +1039,15 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
}
}
if ((oldstate & Qt::WindowFullScreen) != (newstate & Qt::WindowFullScreen)) {
-#ifdef Q_WS_S60
- CEikStatusPane* statusPane = S60->statusPane();
- CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer();
-#endif
if (newstate & Qt::WindowFullScreen) {
const QRect normalGeometry = geometry();
const QRect r = top->normalGeometry;
setGeometry(qApp->desktop()->screenGeometry(this));
-#ifdef Q_WS_S60
- if (statusPane)
- statusPane->MakeVisible(false);
- if (buttonGroup)
- buttonGroup->MakeVisible(false);
-#endif
+
top->normalGeometry = r;
if (top->normalGeometry.width() < 0)
top->normalGeometry = normalGeometry;
} else {
-#ifdef Q_WS_S60
- if (statusPane)
- statusPane->MakeVisible(true);
- if (buttonGroup)
- buttonGroup->MakeVisible(true);
-#endif
if (newstate & Qt::WindowMaximized) {
const QRect r = top->normalGeometry;
setGeometry(qApp->desktop()->availableGeometry(this));