From b644388c82438f64566857abf84bf5d6be1238a0 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 1 Apr 2011 15:58:56 +0300 Subject: Don't display softkeys/statusbar on FS childs of non-FS windows Fullscreen child windows of non-fullscreen main application window displayed softkeys and status bar when they shouldn't. Fixed it so that fullscreen windows never display these items (except for softkeys when explicitly specified to do so.) Task-number: QTTH-1207 Reviewed-by: Sami Merila --- src/gui/kernel/qapplication_s60.cpp | 87 ++++++++++++++++++++++++------------- src/gui/kernel/qt_s60_p.h | 1 + src/gui/kernel/qwidget_s60.cpp | 33 +------------- 3 files changed, 58 insertions(+), 63 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 0427ae4..1856ead 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -142,6 +142,60 @@ void QS60Data::setStatusPaneAndButtonGroupVisibility(bool statusPaneVisible, boo // Ensure that control rectangle is updated static_cast(QApplication::activeWindow()->winId())->handleClientAreaChange(); } + +bool QS60Data::setRecursiveDecorationsVisibility(QWidget *window, Qt::WindowStates newState) +{ + // Show statusbar: + // Topmost parent: Show unless fullscreen/minimized. + // Child windows: Follow topmost parent, unless fullscreen, in which case do not show statusbar + // Show CBA: + // Topmost parent: Show unless fullscreen/minimized. + // Exception: Show if fullscreen with Qt::WindowSoftkeysVisibleHint. + // Child windows: + // Minimized: Unclear if there is an use case for having focused minimized window at all. + // Always follow topmost parent just to be safe. + // Maximized and normal: follow topmost parent. + // Exception: If topmost parent is not showing CBA, show CBA if any softkey actions are + // defined. + // Fullscreen: Show only if Qt::WindowSoftkeysVisibleHint set. + + Qt::WindowStates comparisonState = newState; + QWidget *parentWindow = window->parentWidget(); + if (parentWindow) { + while (parentWindow->parentWidget()) + parentWindow = parentWindow->parentWidget(); + comparisonState = parentWindow->windowState(); + } else { + parentWindow = window; + } + + bool decorationsVisible = !(comparisonState & (Qt::WindowFullScreen | Qt::WindowMinimized)); + const bool parentIsFullscreen = comparisonState & Qt::WindowFullScreen; + const bool parentCbaVisibilityHint = parentWindow->windowFlags() & Qt::WindowSoftkeysVisibleHint; + bool buttonGroupVisibility = (decorationsVisible || (parentIsFullscreen && parentCbaVisibilityHint)); + + // Do extra checking for child windows + if (window->parentWidget()) { + if (newState & Qt::WindowFullScreen) { + decorationsVisible = false; + if (window->windowFlags() & Qt::WindowSoftkeysVisibleHint) + buttonGroupVisibility = true; + else + buttonGroupVisibility = false; + } else if (!(newState & Qt::WindowMinimized) && !buttonGroupVisibility) { + for (int i = 0; i < window->actions().size(); ++i) { + if (window->actions().at(i)->softKeyRole() != QAction::NoSoftKey) { + buttonGroupVisibility = true; + break; + } + } + } + } + + S60->setStatusPaneAndButtonGroupVisibility(decorationsVisible, buttonGroupVisibility); + + return decorationsVisible; +} #endif void QS60Data::controlVisibilityChanged(CCoeControl *control, bool visible) @@ -1271,37 +1325,8 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) qwidget->d_func()->setWindowIcon_sys(true); qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle()); #ifdef Q_WS_S60 - if (qwidget->isWindow()) { - QWidget *const window = qwidget->window(); - QWidget *parentWindow = window->parentWidget(); - if (parentWindow) { - while (parentWindow->parentWidget()) - parentWindow = parentWindow->parentWidget(); - } else { - parentWindow = window; - } - - const bool parentDecorationsVisible = !(parentWindow->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized)); - const bool parentIsFullscreen = parentWindow->windowState() & Qt::WindowFullScreen; - const bool parentCbaVisibilityHint = parentWindow->windowFlags() & Qt::WindowSoftkeysVisibleHint; - bool buttonGroupVisibility = (parentDecorationsVisible || (parentIsFullscreen && parentCbaVisibilityHint)); - - // For non-toplevel normal and maximized windows, show cba if window has softkey - // actions even if topmost parent is not showing cba. Do the same for fullscreen - // windows that request it. - if (!buttonGroupVisibility - && window->parentWidget() - && !(window->windowState() & Qt::WindowMinimized) - && ((window->windowFlags() & Qt::WindowSoftkeysVisibleHint) || !(window->windowState() & Qt::WindowFullScreen))) { - for (int i = 0; i < window->actions().size(); ++i) { - if (window->actions().at(i)->softKeyRole() != QAction::NoSoftKey) { - buttonGroupVisibility = true; - break; - } - } - } - S60->setStatusPaneAndButtonGroupVisibility(parentDecorationsVisible, buttonGroupVisibility); - } + if (qwidget->isWindow()) + S60->setRecursiveDecorationsVisibility(qwidget, qwidget->windowState()); #endif } else if (QApplication::activeWindow() == qwidget->window()) { bool focusedControlFound = false; diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index 102c0ca..ee0b862 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -178,6 +178,7 @@ public: static inline CEikButtonGroupContainer* buttonGroupContainer(); static inline void setButtonGroupContainer(CEikButtonGroupContainer* newCba); static void setStatusPaneAndButtonGroupVisibility(bool statusPaneVisible, bool buttonGroupVisible); + static bool setRecursiveDecorationsVisibility(QWidget *window, Qt::WindowStates newState); #endif static void controlVisibilityChanged(CCoeControl *control, bool visible); diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 8b57701..10bb98b 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -1206,41 +1206,10 @@ void QWidget::setWindowState(Qt::WindowStates newstate) } #ifdef Q_WS_S60 - // Hide window decoration when switching to fullscreen / minimized otherwise show decoration. // 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 unnecessary redraws - Qt::WindowStates comparisonState = newstate; - QWidget *parentWindow = parentWidget(); - if (parentWindow) { - while (parentWindow->parentWidget()) - parentWindow = parentWindow->parentWidget(); - comparisonState = parentWindow->windowState(); - } else { - parentWindow = this; - } - - const bool decorationsVisible = !(comparisonState & (Qt::WindowFullScreen | Qt::WindowMinimized)); - const bool parentIsFullscreen = comparisonState & Qt::WindowFullScreen; - const bool parentCbaVisibilityHint = parentWindow->windowFlags() & Qt::WindowSoftkeysVisibleHint; - bool buttonGroupVisibility = (decorationsVisible || (parentIsFullscreen && parentCbaVisibilityHint)); - - // For non-toplevel normal and maximized windows, show cba if window has softkey - // actions even if topmost parent is not showing cba. Do the same for fullscreen - // windows that request it. - if (!buttonGroupVisibility - && parentWidget() - && !(newstate & Qt::WindowMinimized) - && ((windowFlags() & Qt::WindowSoftkeysVisibleHint) || !(newstate & Qt::WindowFullScreen))) { - for (int i = 0; i < actions().size(); ++i) { - if (actions().at(i)->softKeyRole() != QAction::NoSoftKey) { - buttonGroupVisibility = true; - break; - } - } - } - S60->setStatusPaneAndButtonGroupVisibility(decorationsVisible, buttonGroupVisibility); - + bool decorationsVisible = S60->setRecursiveDecorationsVisibility(this, newstate); #endif // Q_WS_S60 // Ensure the initial size is valid, since we store it as normalGeometry below. -- cgit v0.12 From 64e640716204af69056c34ddac5ce26628a1edd2 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Fri, 1 Apr 2011 16:26:56 +0200 Subject: Add the auto detection for OpenGL in configure for makefile build system on Symbian. Task-number: QTBUG-18485 Reviewed-by: Miikka Heikkinen Reviewed-by: axis --- configure | 6 +++--- mkspecs/common/symbian/symbian-makefile.conf | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 0a88c85..62eb009 100755 --- a/configure +++ b/configure @@ -3244,7 +3244,7 @@ if [ "$PLATFORM_QWS" = "yes" ] && [ "$CFG_OPENGL" = "auto" ]; then fi # mac -if [ "$PLATFORM_MAC" = "yes" ]; then +if [ "$PLATFORM_MAC" = "yes"] && [ "$XPLATFORM_SYMBIAN" = "no" ]; then if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then CFG_OPENGL=desktop fi @@ -5537,8 +5537,8 @@ if [ "$PLATFORM_X11" = "yes" ]; then fi fi -# X11/MINGW OpenGL -if [ "$PLATFORM_X11" = "yes" -o "$XPLATFORM_MINGW" = "yes" ]; then +# X11/MINGW/SYMBIAN OpenGL +if [ "$PLATFORM_X11" = "yes" -o "$XPLATFORM_MINGW" = "yes" -o "$XPLATFORM_SYMBIAN" = "yes" ]; then # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es2 = OpenGL ES 2.x) if [ "$CFG_GUI" = "no" ]; then if [ "$CFG_OPENGL" = "auto" ]; then diff --git a/mkspecs/common/symbian/symbian-makefile.conf b/mkspecs/common/symbian/symbian-makefile.conf index b248117..a725df3 100644 --- a/mkspecs/common/symbian/symbian-makefile.conf +++ b/mkspecs/common/symbian/symbian-makefile.conf @@ -10,6 +10,17 @@ contains(QMAKE_HOST.os,Windows) { include(symbian.conf) +QMAKE_INCDIR_OPENGL = $${EPOCROOT}epoc32/include +QMAKE_LIBDIR_OPENGL = $${EPOCROOT}epoc32/release/armv5/lib +QMAKE_INCDIR_OPENGL_ES1 = $${EPOCROOT}epoc32/include/GLES +QMAKE_LIBDIR_OPENGL_ES1 = $$QMAKE_LIBDIR_OPENGL +QMAKE_INCDIR_OPENGL_ES2 = $${EPOCROOT}epoc32/include/GLES2 +QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL +QMAKE_INCDIR_EGL = $${EPOCROOT}epoc32/include/EGL +QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL +QMAKE_INCDIR_OPENVG = $${EPOCROOT}epoc32/include/VG +QMAKE_LIBDIR_OPENVG = $$QMAKE_LIBDIR_OPENGL + QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -o $obj $src -- cgit v0.12