summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorAndre Fische <andre.f.fischer Andre Fischerandre.f.fischer@oracle.com>2011-02-11 13:40:26 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-11-06 11:58:13 +0000
commit73f89b5d36dbae26072a1e749f10dfd6ffb6dd6e (patch)
tree707d58425d6c32af698a61d6499bffaab9fb2eea /vcl
parent784909a789f9ba7eb7cf7a6dbf5d8172f49bcc97 (diff)
impress211: #i116911# Accept -1 as special value for multi monitor support.
Conflicts: vcl/source/window/wrkwin.cxx vcl/win/source/window/salframe.cxx
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/wrkwin.cxx2
-rw-r--r--vcl/win/source/window/salframe.cxx33
2 files changed, 28 insertions, 7 deletions
diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx
index a4f79d29ee32..c024716dd395 100644
--- a/vcl/source/window/wrkwin.cxx
+++ b/vcl/source/window/wrkwin.cxx
@@ -188,7 +188,7 @@ void WorkWindow::ShowFullScreenMode( sal_Bool bFullScreenMode, sal_Int32 nDispla
if ( !mbFullScreenMode == !bFullScreenMode )
return;
- if( (nDisplayScreen < 0)
+ if( (nDisplayScreen < -1)
|| (nDisplayScreen >= static_cast<sal_Int32>(Application::GetScreenCount()) ) )
{
nDisplayScreen = GetScreenNumber();
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index d4a066346ec1..bad030035a0a 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -793,8 +793,9 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame,
try
{
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()) )
+ uno::Reference< XIndexAccess > xMultiMon( xFactory->createInstance( "com.sun.star.awt.DisplayAccess" ), UNO_QUERY_THROW );
+ 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;
@@ -808,10 +809,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;
+ 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 = 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& )
@@ -920,6 +939,8 @@ WinSalFrame::WinSalFrame()
// -----------------------------------------------------------------------
void WinSalFrame::updateScreenNumber()
{
+ if( mnDisplay == -1 ) // spans all monitors
+ return;
WinSalSystem* pSys = static_cast<WinSalSystem*>(ImplGetSalSystem());
if( pSys )
{