Ignore:
Timestamp:
Mar 8, 2010, 12:52:58 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.2 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/kernel/qwidget_s60.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    390390            if (!isOpaque) {
    391391                RWindow *const window = static_cast<RWindow *>(drawableWindow);
     392#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
     393                window->SetSurfaceTransparency(true);
     394#else
    392395                const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
    393396                if (window->SetTransparencyAlphaChannel() == KErrNone)
    394397                    window->SetBackgroundColor(TRgb(255, 255, 255, 0));
     398#endif
    395399            }
    396400        }
     
    708712    RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow());
    709713
     714#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
     715    window->SetSurfaceTransparency(!isOpaque);
     716#else
    710717    if (!isOpaque) {
    711718        const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
     
    714721    } else
    715722        window->SetTransparentRegion(TRegionFix<1>());
     723#endif
    716724}
    717725
     
    871879{
    872880    extra->topextra->backingStore = 0;
     881    extra->topextra->inExpose = 0;
    873882}
    874883
     
    10381047
    10391048    if (isWindow()) {
     1049
     1050        QSymbianControl *window = static_cast<QSymbianControl *>(effectiveWinId());
     1051        if (window && newstate & Qt::WindowMinimized) {
     1052            window->setFocusSafely(false);
     1053            window->MakeVisible(false);
     1054        } else if (window && oldstate & Qt::WindowMinimized) {
     1055            window->setFocusSafely(true);
     1056            window->MakeVisible(true);
     1057        }
     1058
    10401059#ifdef Q_WS_S60
    1041         // Change window decoration visibility if switching to or from fullsccreen
    1042         // In addition decoration visibility is changed when the initial has been
    1043         // WindowNoState.
    1044         // The window decoration visibility has to be changed before doing actual
    1045         // window state change since in that order the availableGeometry will return
    1046         // directly the right size and we will avoid unnecessarty redraws
    1047         if ((oldstate & Qt::WindowFullScreen) != (newstate & Qt::WindowFullScreen) ||
    1048             oldstate == Qt::WindowNoState) {
    1049             CEikStatusPane* statusPane = S60->statusPane();
    1050             CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer();
    1051             if (newstate & Qt::WindowFullScreen) {
    1052                 if (statusPane)
    1053                     statusPane->MakeVisible(false);
    1054                 if (buttonGroup)
    1055                     buttonGroup->MakeVisible(false);
    1056             } else {
    1057                 if (statusPane)
    1058                     statusPane->MakeVisible(true);
    1059                 if (buttonGroup)
    1060                     buttonGroup->MakeVisible(true);
    1061             }
    1062 
    1063         }
     1060        // Hide window decoration when switching to fullsccreen / minimized otherwise show decoration.
     1061        // The window decoration visibility has to be changed before doing actual window state
     1062        // change since in that order the availableGeometry will return directly the right size and
     1063        // we will avoid unnecessarty redraws
     1064        CEikStatusPane* statusPane = S60->statusPane();
     1065        CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer();
     1066        TBool visible = !(newstate & (Qt::WindowFullScreen | Qt::WindowMinimized));
     1067        if (statusPane)
     1068            statusPane->MakeVisible(visible);
     1069        if (buttonGroup)
     1070            buttonGroup->MakeVisible(visible);
    10641071#endif // Q_WS_S60
    10651072
    10661073        createWinId();
    10671074        Q_ASSERT(testAttribute(Qt::WA_WState_Created));
    1068         QTLWExtra *top = d->topData();
    1069 
    10701075        // Ensure the initial size is valid, since we store it as normalGeometry below.
    10711076        if (!testAttribute(Qt::WA_Resized) && !isVisible())
    10721077            adjustSize();
    10731078
    1074         if ((oldstate & Qt::WindowMaximized) != (newstate & Qt::WindowMaximized)) {
    1075             if ((newstate & Qt::WindowMaximized)) {
    1076                 const QRect normalGeometry = geometry();
    1077 
    1078                 const QRect r = top->normalGeometry;
    1079                 setGeometry(qApp->desktop()->availableGeometry(this));
    1080                 top->normalGeometry = r;
    1081 
    1082                 if (top->normalGeometry.width() < 0)
    1083                     top->normalGeometry = normalGeometry;
    1084             } else {
    1085                 // restore original geometry
    1086                 setGeometry(top->normalGeometry);
    1087             }
    1088         }
    1089         if ((oldstate & Qt::WindowFullScreen) != (newstate & Qt::WindowFullScreen)) {
    1090             if (newstate & Qt::WindowFullScreen) {
    1091                 const QRect normalGeometry = geometry();
    1092                 const QRect r = top->normalGeometry;
    1093                 setGeometry(qApp->desktop()->screenGeometry(this));
    1094 
    1095                 top->normalGeometry = r;
    1096                 if (top->normalGeometry.width() < 0)
    1097                     top->normalGeometry = normalGeometry;
    1098             } else {
    1099                 if (newstate & Qt::WindowMaximized) {
    1100                     const QRect r = top->normalGeometry;
    1101                     setGeometry(qApp->desktop()->availableGeometry(this));
    1102                     top->normalGeometry = r;
    1103                 } else {
    1104                     setGeometry(top->normalGeometry);
    1105                 }
    1106             }
    1107         }
    1108         if ((oldstate & Qt::WindowMinimized) != (newstate & Qt::WindowMinimized)) {
    1109             if (newstate & Qt::WindowMinimized) {
    1110                 if (isVisible()) {
    1111                     QSymbianControl *id = static_cast<QSymbianControl *>(effectiveWinId());
    1112                     if (id->IsFocused()) // Avoid unnecessary calls to FocusChanged()
    1113                         id->setFocusSafely(false);
    1114                     id->MakeVisible(false);
    1115                 }
    1116             } else {
    1117                 if (isVisible()) {
    1118                     QSymbianControl *id = static_cast<QSymbianControl *>(effectiveWinId());
    1119                     id->MakeVisible(true);
    1120                     if (!id->IsFocused()) // Avoid unnecessary calls to FocusChanged()
    1121                         id->setFocusSafely(true);
    1122                 }
    1123                 const QRect normalGeometry = geometry();
    1124                 const QRect r = top->normalGeometry;
    1125                 top->normalGeometry = r;
    1126                 if (top->normalGeometry.width() < 0)
    1127                     top->normalGeometry = normalGeometry;
    1128             }
    1129         }
     1079        QTLWExtra *top = d->topData();
     1080        const QRect normalGeometry = (top->normalGeometry.width() < 0) ? geometry() : top->normalGeometry;
     1081
     1082        if (newstate & Qt::WindowFullScreen)
     1083            setGeometry(qApp->desktop()->screenGeometry(this));
     1084        else if (newstate & Qt::WindowMaximized)
     1085            setGeometry(qApp->desktop()->availableGeometry(this));
     1086        else
     1087            setGeometry(normalGeometry);
     1088
     1089        //restore normal geometry
     1090        top->normalGeometry = normalGeometry;
    11301091    }
    11311092
     
    11871148    if (destroyWindow) {
    11881149        delete id;
     1150        // At this point the backing store should already be destroyed
     1151        // so we flush the command buffer to ensure that the freeing of
     1152        // those resources and deleting the window can happen "atomically"
     1153        S60->wsSession().Flush();
    11891154    }
    11901155}
Note: See TracChangeset for help on using the changeset viewer.