From a957ed92a61d9311ed163dba15f2b6f8d30bf03c Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Wed, 18 Aug 2010 15:36:09 +0100 Subject: Ensure geometry of top-level widget accounts for S60 screen furniture If the S60 screen furniture has already been constructed before QWidgetPrivate::show_sys() is called on a top-level widget which has Qt::WindowMaximized set (e.g. due to a showMaximized() call), its geometry is set to the full screen extent, including the regions covered by the status bar and CBA. This patch ensures that calculation of the widget geometry always takes into account the screen furniture. Task-number: QTBUG-12605 Reviewed-by: Jason Barron --- src/gui/kernel/qwidget_s60.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 319f330..7ab9fbc 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -482,14 +482,13 @@ void QWidgetPrivate::show_sys() activateSymbianWindow(); QSymbianControl *id = static_cast(q->internalWinId()); + const bool isFullscreen = q->windowState() & Qt::WindowFullScreen; #ifdef Q_WS_S60 // Lazily initialize the S60 screen furniture when the first window is shown. if (!QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes) && !S60->buttonGroupContainer() && !S60->statusPane()) { - bool isFullscreen = q->windowState() & Qt::WindowFullScreen; - if (!q->testAttribute(Qt::WA_DontShowOnScreen)) { // Create the status pane and CBA here @@ -504,23 +503,24 @@ void QWidgetPrivate::show_sys() // Can't use AppUi directly because it privately inherits from MEikStatusPaneObserver. QSymbianControl *desktopControl = static_cast(QApplication::desktop()->winId()); S60->statusPane()->SetObserver(desktopControl); - - // Hide the status pane if fullscreen OR - // Fill client area if maximized OR - // Put window below status pane unless the window has an explicit position. - if (isFullscreen) { + if (isFullscreen) S60->statusPane()->MakeVisible(false); - } else if (q->windowState() & Qt::WindowMaximized) { - TRect r = static_cast(S60->appUi())->ClientRect(); - id->SetExtent(r.iTl, r.Size()); - } else if (!q->testAttribute(Qt::WA_Moved)) { - id->SetPosition(static_cast(S60->appUi())->ClientRect().iTl); - } } } } #endif + // Fill client area if maximized OR + // Put window below status pane unless the window has an explicit position. + if (!isFullscreen) { + if (q->windowState() & Qt::WindowMaximized) { + TRect r = static_cast(S60->appUi())->ClientRect(); + id->SetExtent(r.iTl, r.Size()); + } else if (!q->testAttribute(Qt::WA_Moved)) { + id->SetPosition(static_cast(S60->appUi())->ClientRect().iTl); + } + } + id->MakeVisible(true); if(q->isWindow()) -- cgit v0.12