Hi everyone!
I just found a weird problem when using a specific theme on my N95 and swithcing between landscape and potrait mode. The theme I was using has transperent Highlightnig (i.e in a listbox the selected item is shown with this UI compontent). As it seems when scrolling down i my listbox the background skin and the area around the scrollbar is not redrawn correctly. The highlighet color remains on the background and around the scrollbar. This happens only the first time if that container hasn't been drawn previously and the switching between landscape and potriat mode happened in the same view, but different container was shown. Also the problem only occures using that theme.

The code that I use for detecting a switch from landscape and potrait mode is as following:

void MyContainer::HandleResourceChange(TInt aType)
{
if (aType == KEikDynamicLayoutVariantSwitch)
{
TRect rect = iEikonEnv->EikAppUi()->ClientRect();
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
SetRect(rect);
}
CCoeControl::HandleResourceChange(aType);
}

void MyContainer::SizeChanged()
{
TPoint point(0,0);
if(iConnectionSettingsListBox)
{
iConnectionSettingsListBox->SetPosition(point);
iConnectionSettingsListBox->SetSize(iEikonEnv->EikAppUi()->ClientRect().Size());
iConnectionSettingsListBox->ListBox()->SetPosition(point);
iConnectionSettingsListBox->ListBox()->SetSize(iEikonEnv->EikAppUi()->ClientRect().Size());
}
if(iUserSettingsListBox)
{
iUserSettingsListBox->SetPosition(point);
iUserSettingsListBox->SetSize(iEikonEnv->EikAppUi()->ClientRect().Size());
iUserSettingsListBox->ListBox()->SetPosition(point);
iUserSettingsListBox->ListBox()->SetSize(iEikonEnv->EikAppUi()->ClientRect().Size());
}
if(iAboutLabel)
{
iAboutLabel->SetPosition(point);
iAboutLabel->SetSize(iEikonEnv->EikAppUi()->ClientRect().Size());
}
if(iBgContext)
{
TRect rect(point, iEikonEnv->EikAppUi()->ClientRect().Size());
iBgContext->SetRect(rect);
}
}

void MyContainer::Draw( const TRect& /*aRect*/ ) const
{
CWindowGc& gc = SystemGc();
TRect rect = Rect();

MAknsSkinInstance* skin = AknsUtils::SkinInstance();
MAknsControlContext* cc = AknsDrawUtils::ControlContext(this);
TBool result =AknsDrawUtils::Background(skin, cc, gc, rect);
}


The UI has one container that owns the window and several containers with subcompontets that are drawn in the window, switching between the containers is done by using tabs. The window owning container supplys a MobSupplyObject with a Background context that it also owns.

I had a simillar problems with the tabs but that was resolved by make sure that all the tabs are on the CAknNavigationControlContainer stack when my views are created (i.e. views that don't have tabs can push the default navigation decorator on the stack to make tabs disappear).

Has anybody experienced simillar problems ? Is there a correct way to handle switching between landscape and potrait mode and using tabs and several containers in a view?

Thanks in advance

Best Regards!