Kaydet (Commit) 98664433 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

fdo#66864: Return from full-screen should restore toolbars.

The fix for fdo#37758 was not correct, we shouldn't fiddle with the m_bVisible
itself, but instead react on the m_bMasterHide flag; or at least that is my
understanding of the related framework code (why is it so confusing?!)

Change-Id: I791fcea9e5e5313b6a5b776cb3187cbd1a028386
üst 01af3e2e
...@@ -294,7 +294,7 @@ Rectangle ToolbarLayoutManager::implts_calcDockingArea() ...@@ -294,7 +294,7 @@ Rectangle ToolbarLayoutManager::implts_calcDockingArea()
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
if ( pWindow && !xDockWindow->isFloating() && pConstIter->m_bVisible ) if ( pWindow && !xDockWindow->isFloating() && pConstIter->m_bVisible && !pConstIter->m_bMasterHide )
{ {
awt::Rectangle aPosSize = xWindow->getPosSize(); awt::Rectangle aPosSize = xWindow->getPosSize();
if ( pConstIter->m_aDockedData.m_nDockedArea != nCurrDockingArea ) if ( pConstIter->m_aDockedData.m_nDockedArea != nCurrDockingArea )
...@@ -442,7 +442,7 @@ bool ToolbarLayoutManager::requestToolbar( const OUString& rResourceURL ) ...@@ -442,7 +442,7 @@ bool ToolbarLayoutManager::requestToolbar( const OUString& rResourceURL )
if ( !xUIElement.is() ) if ( !xUIElement.is() )
bMustCallCreate = true; bMustCallCreate = true;
bool bCreateOrShowToolbar( aRequestedToolbar.m_bVisible & !aRequestedToolbar.m_bMasterHide ); bool bCreateOrShowToolbar( aRequestedToolbar.m_bVisible && !aRequestedToolbar.m_bMasterHide );
uno::Reference< awt::XWindow2 > xContainerWindow( m_xContainerWindow, uno::UNO_QUERY ); uno::Reference< awt::XWindow2 > xContainerWindow( m_xContainerWindow, uno::UNO_QUERY );
if ( xContainerWindow.is() && aRequestedToolbar.m_bFloating ) if ( xContainerWindow.is() && aRequestedToolbar.m_bFloating )
...@@ -681,28 +681,24 @@ void ToolbarLayoutManager::setVisible( bool bVisible ) ...@@ -681,28 +681,24 @@ void ToolbarLayoutManager::setVisible( bool bVisible )
UIElementVector::iterator pIter; UIElementVector::iterator pIter;
for ( pIter = aUIElementVector.begin(); pIter != aUIElementVector.end(); ++pIter ) for ( pIter = aUIElementVector.begin(); pIter != aUIElementVector.end(); ++pIter )
{ {
pIter->m_bMasterHide = !bVisible; if (!pIter->m_bFloating)
{
UIElement aUIElement(*pIter);
aUIElement.m_bMasterHide = !bVisible;
implts_setToolbar(aUIElement);
implts_setLayoutDirty();
}
Window* pWindow = getWindowFromXUIElement( pIter->m_xUIElement ); Window* pWindow = getWindowFromXUIElement( pIter->m_xUIElement );
if ( pWindow ) if ( pWindow )
{ {
bool bSetVisible( pIter->m_bVisible & bVisible ); bool bSetVisible( pIter->m_bVisible && bVisible );
if ( !bSetVisible ) if ( !bSetVisible )
{
pWindow->Hide(); pWindow->Hide();
UIElement aUIElement( *pIter );
if ( !aUIElement.m_bFloating )
implts_setLayoutDirty();
aUIElement.m_bVisible = false;
implts_setToolbar( aUIElement );
}
else else
{ {
if ( pIter->m_bFloating ) if ( pIter->m_bFloating )
pWindow->Show(true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); pWindow->Show(true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
else
implts_setLayoutDirty();
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment