summaryrefslogtreecommitdiffstats
path: root/vcl/win/source/window/salframe.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/win/source/window/salframe.cxx')
-rwxr-xr-xvcl/win/source/window/salframe.cxx31
1 files changed, 26 insertions, 5 deletions
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index bcbaee6d8b6c..a82e6a152efc 100755
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -875,7 +875,8 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame,
{
uno::Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
uno::Reference< XIndexAccess > xMultiMon( xFactory->createInstance(OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.DisplayAccess" ) ) ), UNO_QUERY_THROW );
- if( (pFrame->mnDisplay >= 0) && (pFrame->mnDisplay < xMultiMon->getCount()) )
+ sal_Int32 nMonitors = xMultiMon->getCount();
+ if( (pFrame->mnDisplay >= 0) && (pFrame->mnDisplay < nMonitors) )
{
uno::Reference< XPropertySet > xMonitor( xMultiMon->getByIndex( pFrame->mnDisplay ), UNO_QUERY_THROW );
com::sun::star::awt::Rectangle aRect;
@@ -889,10 +890,28 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame,
}
else
{
- nScreenX = GetSystemMetrics( SM_XVIRTUALSCREEN );
- nScreenY = GetSystemMetrics( SM_YVIRTUALSCREEN );
- nScreenDX = GetSystemMetrics( SM_CXVIRTUALSCREEN );
- nScreenDY = GetSystemMetrics( SM_CYVIRTUALSCREEN );
+ Rectangle aCombined;
+ uno::Reference< XPropertySet > xMonitor( xMultiMon->getByIndex( 0 ), UNO_QUERY_THROW );
+ com::sun::star::awt::Rectangle aRect;
+ if( xMonitor->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ScreenArea" ) ) ) >>= aRect )
+ {
+ aCombined.Left() = aRect.X;
+ aCombined.Top() = aRect.Y;
+ aCombined.Right() = aRect.X + aRect.Width;
+ aCombined.Bottom() = aRect.Y + aRect.Height;
+ for( sal_Int32 i = 1 ; i < nMonitors ; i++ )
+ {
+ xMonitor = uno::Reference< XPropertySet >( xMultiMon->getByIndex(i), UNO_QUERY_THROW );
+ if( xMonitor->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ScreenArea" ) ) ) >>= aRect )
+ {
+ aCombined.Union( Rectangle( aRect.X, aRect.Y, aRect.X+aRect.Width, aRect.Y+aRect.Height ) );
+ }
+ }
+ }
+ nScreenX = aCombined.Left();
+ nScreenY = aCombined.Top();
+ nScreenDX = aCombined.GetWidth();
+ nScreenDY = aCombined.GetHeight();
}
}
catch( Exception& )
@@ -1001,6 +1020,8 @@ WinSalFrame::WinSalFrame()
// -----------------------------------------------------------------------
void WinSalFrame::updateScreenNumber()
{
+ if( mnDisplay == -1 ) // spans all monitors
+ return;
WinSalSystem* pSys = static_cast<WinSalSystem*>(ImplGetSalSystem());
if( pSys )
{