387 | EPointerFilterMove | EPointerFilterDrag, 0); |
387 | EPointerFilterMove | EPointerFilterDrag, 0); |
388 drawableWindow->EnableVisibilityChangeEvents(); |
388 drawableWindow->EnableVisibilityChangeEvents(); |
389 |
389 |
390 if (!isOpaque) { |
390 if (!isOpaque) { |
391 RWindow *const window = static_cast<RWindow *>(drawableWindow); |
391 RWindow *const window = static_cast<RWindow *>(drawableWindow); |
|
392 #ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE |
|
393 window->SetSurfaceTransparency(true); |
|
394 #else |
392 const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA)); |
395 const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA)); |
393 if (window->SetTransparencyAlphaChannel() == KErrNone) |
396 if (window->SetTransparencyAlphaChannel() == KErrNone) |
394 window->SetBackgroundColor(TRgb(255, 255, 255, 0)); |
397 window->SetBackgroundColor(TRgb(255, 255, 255, 0)); |
|
398 #endif |
395 } |
399 } |
396 } |
400 } |
397 |
401 |
398 q->setAttribute(Qt::WA_WState_Created); |
402 q->setAttribute(Qt::WA_WState_Created); |
399 |
403 |
705 if ((data.window_flags & Qt::FramelessWindowHint) == 0) |
709 if ((data.window_flags & Qt::FramelessWindowHint) == 0) |
706 return; |
710 return; |
707 |
711 |
708 RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow()); |
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 if (!isOpaque) { |
717 if (!isOpaque) { |
711 const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA)); |
718 const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA)); |
712 if (window->SetTransparencyAlphaChannel() == KErrNone) |
719 if (window->SetTransparencyAlphaChannel() == KErrNone) |
713 window->SetBackgroundColor(TRgb(255, 255, 255, 0)); |
720 window->SetBackgroundColor(TRgb(255, 255, 255, 0)); |
714 } else |
721 } else |
715 window->SetTransparentRegion(TRegionFix<1>()); |
722 window->SetTransparentRegion(TRegionFix<1>()); |
|
723 #endif |
716 } |
724 } |
717 |
725 |
718 void QWidgetPrivate::setWindowIcon_sys(bool forceReset) |
726 void QWidgetPrivate::setWindowIcon_sys(bool forceReset) |
719 { |
727 { |
720 #ifdef Q_WS_S60 |
728 #ifdef Q_WS_S60 |
1041 Qt::WindowStates oldstate = windowState(); |
1044 Qt::WindowStates oldstate = windowState(); |
1042 if (oldstate == newstate) |
1045 if (oldstate == newstate) |
1043 return; |
1046 return; |
1044 |
1047 |
1045 if (isWindow()) { |
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 |
1046 #ifdef Q_WS_S60 |
1059 #ifdef Q_WS_S60 |
1047 // Change window decoration visibility if switching to or from fullsccreen |
1060 // Hide window decoration when switching to fullsccreen / minimized otherwise show decoration. |
1048 // In addition decoration visibility is changed when the initial has been |
1061 // The window decoration visibility has to be changed before doing actual window state |
1049 // WindowNoState. |
1062 // change since in that order the availableGeometry will return directly the right size and |
1050 // The window decoration visibility has to be changed before doing actual |
1063 // we will avoid unnecessarty redraws |
1051 // window state change since in that order the availableGeometry will return |
1064 CEikStatusPane* statusPane = S60->statusPane(); |
1052 // directly the right size and we will avoid unnecessarty redraws |
1065 CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer(); |
1053 if ((oldstate & Qt::WindowFullScreen) != (newstate & Qt::WindowFullScreen) || |
1066 TBool visible = !(newstate & (Qt::WindowFullScreen | Qt::WindowMinimized)); |
1054 oldstate == Qt::WindowNoState) { |
1067 if (statusPane) |
1055 CEikStatusPane* statusPane = S60->statusPane(); |
1068 statusPane->MakeVisible(visible); |
1056 CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer(); |
1069 if (buttonGroup) |
1057 if (newstate & Qt::WindowFullScreen) { |
1070 buttonGroup->MakeVisible(visible); |
1058 if (statusPane) |
|
1059 statusPane->MakeVisible(false); |
|
1060 if (buttonGroup) |
|
1061 buttonGroup->MakeVisible(false); |
|
1062 } else { |
|
1063 if (statusPane) |
|
1064 statusPane->MakeVisible(true); |
|
1065 if (buttonGroup) |
|
1066 buttonGroup->MakeVisible(true); |
|
1067 } |
|
1068 |
|
1069 } |
|
1070 #endif // Q_WS_S60 |
1071 #endif // Q_WS_S60 |
1071 |
1072 |
1072 createWinId(); |
1073 createWinId(); |
1073 Q_ASSERT(testAttribute(Qt::WA_WState_Created)); |
1074 Q_ASSERT(testAttribute(Qt::WA_WState_Created)); |
1074 QTLWExtra *top = d->topData(); |
|
1075 |
|
1076 // Ensure the initial size is valid, since we store it as normalGeometry below. |
1075 // Ensure the initial size is valid, since we store it as normalGeometry below. |
1077 if (!testAttribute(Qt::WA_Resized) && !isVisible()) |
1076 if (!testAttribute(Qt::WA_Resized) && !isVisible()) |
1078 adjustSize(); |
1077 adjustSize(); |
1079 |
1078 |
1080 if ((oldstate & Qt::WindowMaximized) != (newstate & Qt::WindowMaximized)) { |
1079 QTLWExtra *top = d->topData(); |
1081 if ((newstate & Qt::WindowMaximized)) { |
1080 const QRect normalGeometry = (top->normalGeometry.width() < 0) ? geometry() : top->normalGeometry; |
1082 const QRect normalGeometry = geometry(); |
1081 |
1083 |
1082 if (newstate & Qt::WindowFullScreen) |
1084 const QRect r = top->normalGeometry; |
1083 setGeometry(qApp->desktop()->screenGeometry(this)); |
1085 setGeometry(qApp->desktop()->availableGeometry(this)); |
1084 else if (newstate & Qt::WindowMaximized) |
1086 top->normalGeometry = r; |
1085 setGeometry(qApp->desktop()->availableGeometry(this)); |
1087 |
1086 else |
1088 if (top->normalGeometry.width() < 0) |
1087 setGeometry(normalGeometry); |
1089 top->normalGeometry = normalGeometry; |
1088 |
1090 } else { |
1089 //restore normal geometry |
1091 // restore original geometry |
1090 top->normalGeometry = normalGeometry; |
1092 setGeometry(top->normalGeometry); |
|
1093 } |
|
1094 } |
|
1095 if ((oldstate & Qt::WindowFullScreen) != (newstate & Qt::WindowFullScreen)) { |
|
1096 if (newstate & Qt::WindowFullScreen) { |
|
1097 const QRect normalGeometry = geometry(); |
|
1098 const QRect r = top->normalGeometry; |
|
1099 setGeometry(qApp->desktop()->screenGeometry(this)); |
|
1100 |
|
1101 top->normalGeometry = r; |
|
1102 if (top->normalGeometry.width() < 0) |
|
1103 top->normalGeometry = normalGeometry; |
|
1104 } else { |
|
1105 if (newstate & Qt::WindowMaximized) { |
|
1106 const QRect r = top->normalGeometry; |
|
1107 setGeometry(qApp->desktop()->availableGeometry(this)); |
|
1108 top->normalGeometry = r; |
|
1109 } else { |
|
1110 setGeometry(top->normalGeometry); |
|
1111 } |
|
1112 } |
|
1113 } |
|
1114 if ((oldstate & Qt::WindowMinimized) != (newstate & Qt::WindowMinimized)) { |
|
1115 if (newstate & Qt::WindowMinimized) { |
|
1116 if (isVisible()) { |
|
1117 QSymbianControl *id = static_cast<QSymbianControl *>(effectiveWinId()); |
|
1118 if (id->IsFocused()) // Avoid unnecessary calls to FocusChanged() |
|
1119 id->setFocusSafely(false); |
|
1120 id->MakeVisible(false); |
|
1121 } |
|
1122 } else { |
|
1123 if (isVisible()) { |
|
1124 QSymbianControl *id = static_cast<QSymbianControl *>(effectiveWinId()); |
|
1125 id->MakeVisible(true); |
|
1126 if (!id->IsFocused()) // Avoid unnecessary calls to FocusChanged() |
|
1127 id->setFocusSafely(true); |
|
1128 } |
|
1129 const QRect normalGeometry = geometry(); |
|
1130 const QRect r = top->normalGeometry; |
|
1131 top->normalGeometry = r; |
|
1132 if (top->normalGeometry.width() < 0) |
|
1133 top->normalGeometry = normalGeometry; |
|
1134 } |
|
1135 } |
|
1136 } |
1091 } |
1137 |
1092 |
1138 data->window_state = newstate; |
1093 data->window_state = newstate; |
1139 |
1094 |
1140 if (newstate & Qt::WindowActive) |
1095 if (newstate & Qt::WindowActive) |