Changeset 651 for trunk/src/gui/kernel/qwidget_s60.cpp
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/kernel/qwidget_s60.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 390 390 if (!isOpaque) { 391 391 RWindow *const window = static_cast<RWindow *>(drawableWindow); 392 #ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE 393 window->SetSurfaceTransparency(true); 394 #else 392 395 const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA)); 393 396 if (window->SetTransparencyAlphaChannel() == KErrNone) 394 397 window->SetBackgroundColor(TRgb(255, 255, 255, 0)); 398 #endif 395 399 } 396 400 } … … 708 712 RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow()); 709 713 714 #ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE 715 window->SetSurfaceTransparency(!isOpaque); 716 #else 710 717 if (!isOpaque) { 711 718 const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA)); … … 714 721 } else 715 722 window->SetTransparentRegion(TRegionFix<1>()); 723 #endif 716 724 } 717 725 … … 871 879 { 872 880 extra->topextra->backingStore = 0; 881 extra->topextra->inExpose = 0; 873 882 } 874 883 … … 1038 1047 1039 1048 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 1040 1059 #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); 1064 1071 #endif // Q_WS_S60 1065 1072 1066 1073 createWinId(); 1067 1074 Q_ASSERT(testAttribute(Qt::WA_WState_Created)); 1068 QTLWExtra *top = d->topData();1069 1070 1075 // Ensure the initial size is valid, since we store it as normalGeometry below. 1071 1076 if (!testAttribute(Qt::WA_Resized) && !isVisible()) 1072 1077 adjustSize(); 1073 1078 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; 1130 1091 } 1131 1092 … … 1187 1148 if (destroyWindow) { 1188 1149 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(); 1189 1154 } 1190 1155 }
Note:
See TracChangeset
for help on using the changeset viewer.