remove Application::GetWorkAreaPosSizePixel
This internal API has always been problematic because we cannot support it under the Linux toolkits, where it has in fact always just returned the size of the screen. Change-Id: I406bcbca8a4161b4261ef46940823bb07c6ad18b Reviewed-on: https://gerrit.libreoffice.org/4976 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@suse.com> Tested-by: Michael Meeks <michael.meeks@suse.com>
This commit is contained in:
parent
86b8b3b7e0
commit
ab5eaec098
@ -892,7 +892,7 @@ uno::Reference< frame::XFrame > DocumentHolder::GetDocFrame()
|
|||||||
{
|
{
|
||||||
sal_Int32 nDisplay = Application::GetDisplayBuiltInScreen();
|
sal_Int32 nDisplay = Application::GetDisplayBuiltInScreen();
|
||||||
|
|
||||||
Rectangle aWorkRect = Application::GetWorkAreaPosSizePixel( nDisplay );
|
Rectangle aWorkRect = Application::GetScreenPosSizePixel( nDisplay );
|
||||||
awt::Rectangle aWindowRect = xHWindow->getPosSize();
|
awt::Rectangle aWindowRect = xHWindow->getPosSize();
|
||||||
|
|
||||||
if (( aWindowRect.Width < aWorkRect.GetWidth()) && ( aWindowRect.Height < aWorkRect.GetHeight() ))
|
if (( aWindowRect.Width < aWorkRect.GetWidth()) && ( aWindowRect.Height < aWorkRect.GetHeight() ))
|
||||||
|
@ -2454,7 +2454,7 @@ sal_Bool LayoutManager::implts_resizeContainerWindow( const awt::Size& rContaine
|
|||||||
|
|
||||||
// calculate the maximum size we have for the container window
|
// calculate the maximum size we have for the container window
|
||||||
sal_Int32 nDisplay = xContainerTopWindow->getDisplay();
|
sal_Int32 nDisplay = xContainerTopWindow->getDisplay();
|
||||||
Rectangle aWorkArea = Application::GetWorkAreaPosSizePixel( nDisplay );
|
Rectangle aWorkArea = Application::GetScreenPosSizePixel( nDisplay );
|
||||||
|
|
||||||
if (( aWorkArea.GetWidth() > 0 ) && ( aWorkArea.GetHeight() > 0 ))
|
if (( aWorkArea.GetWidth() > 0 ) && ( aWorkArea.GetHeight() > 0 ))
|
||||||
{
|
{
|
||||||
|
@ -256,7 +256,6 @@ public:
|
|||||||
// in case of IsUnifiedDisplay() == false the return value
|
// in case of IsUnifiedDisplay() == false the return value
|
||||||
// will always be GetDisplayDefaultScreen()
|
// will always be GetDisplayDefaultScreen()
|
||||||
SAL_DLLPRIVATE static unsigned int GetBestScreen( const Rectangle& );
|
SAL_DLLPRIVATE static unsigned int GetBestScreen( const Rectangle& );
|
||||||
static Rectangle GetWorkAreaPosSizePixel( unsigned int nScreen );
|
|
||||||
// This returns the LCD screen number for a laptop, or the primary
|
// This returns the LCD screen number for a laptop, or the primary
|
||||||
// external VGA display for a desktop machine - it is where a presenter
|
// external VGA display for a desktop machine - it is where a presenter
|
||||||
// console should be rendered if there are other (non-built-in) screens
|
// console should be rendered if there are other (non-built-in) screens
|
||||||
|
@ -228,7 +228,6 @@ public:
|
|||||||
|
|
||||||
The Display Screen number is counted the same way that
|
The Display Screen number is counted the same way that
|
||||||
<code>Application::GetScreenPosSizePixel</code>,
|
<code>Application::GetScreenPosSizePixel</code>,
|
||||||
<code>Application::GetWorkAreaPosSizePixel</code>,
|
|
||||||
<code>Application::GetDisplayScreenName</code>
|
<code>Application::GetDisplayScreenName</code>
|
||||||
and of course <code>SystemWindow::SetScreenNumber</code>
|
and of course <code>SystemWindow::SetScreenNumber</code>
|
||||||
are counted in.
|
are counted in.
|
||||||
@ -250,7 +249,6 @@ public:
|
|||||||
|
|
||||||
The Display Screen number is counted the same way that
|
The Display Screen number is counted the same way that
|
||||||
<code>Application::GetScreenPosSizePixel</code>,
|
<code>Application::GetScreenPosSizePixel</code>,
|
||||||
<code>Application::GetWorkAreaPosSizePixel</code>,
|
|
||||||
<code>Application::GetDisplayScreenName</code>
|
<code>Application::GetDisplayScreenName</code>
|
||||||
and of course <code>SystemWindow::GetScreenNumber</code>
|
and of course <code>SystemWindow::GetScreenNumber</code>
|
||||||
are counted in.
|
are counted in.
|
||||||
|
@ -61,25 +61,6 @@ Rectangle AquaSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
|
|||||||
return aRet;
|
return aRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle AquaSalSystem::GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen )
|
|
||||||
{
|
|
||||||
NSArray* pScreens = [NSScreen screens];
|
|
||||||
Rectangle aRet;
|
|
||||||
NSScreen* pScreen = nil;
|
|
||||||
if( pScreens && nScreen < [pScreens count] )
|
|
||||||
pScreen = [pScreens objectAtIndex: nScreen];
|
|
||||||
else
|
|
||||||
pScreen = [NSScreen mainScreen];
|
|
||||||
|
|
||||||
if( pScreen )
|
|
||||||
{
|
|
||||||
NSRect aFrame = [pScreen visibleFrame];
|
|
||||||
aRet = Rectangle( Point( static_cast<long int>(aFrame.origin.x), static_cast<long int>(aFrame.origin.y) ),
|
|
||||||
Size( static_cast<long int>(aFrame.size.width), static_cast<long int>(aFrame.size.height) ) );
|
|
||||||
}
|
|
||||||
return aRet;
|
|
||||||
}
|
|
||||||
|
|
||||||
OUString AquaSalSystem::GetDisplayScreenName( unsigned int nScreen )
|
OUString AquaSalSystem::GetDisplayScreenName( unsigned int nScreen )
|
||||||
{
|
{
|
||||||
NSArray* pScreens = [NSScreen screens];
|
NSArray* pScreens = [NSScreen screens];
|
||||||
|
@ -64,11 +64,6 @@ Rectangle SvpSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
|
|||||||
return aRect;
|
return aRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle SvpSalSystem::GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen )
|
|
||||||
{
|
|
||||||
return GetDisplayScreenPosSizePixel( nScreen );
|
|
||||||
}
|
|
||||||
|
|
||||||
OUString SvpSalSystem::GetDisplayScreenName( unsigned int nScreen )
|
OUString SvpSalSystem::GetDisplayScreenName( unsigned int nScreen )
|
||||||
{
|
{
|
||||||
return "VirtualScreen " + OUString::valueOf(sal_Int32(nScreen));
|
return "VirtualScreen " + OUString::valueOf(sal_Int32(nScreen));
|
||||||
|
@ -37,7 +37,6 @@ public:
|
|||||||
// get info about the display
|
// get info about the display
|
||||||
virtual unsigned int GetDisplayScreenCount();
|
virtual unsigned int GetDisplayScreenCount();
|
||||||
virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen );
|
virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen );
|
||||||
virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen );
|
|
||||||
|
|
||||||
virtual OUString GetDisplayScreenName( unsigned int nScreen );
|
virtual OUString GetDisplayScreenName( unsigned int nScreen );
|
||||||
virtual int ShowNativeMessageBox( const OUString& rTitle,
|
virtual int ShowNativeMessageBox( const OUString& rTitle,
|
||||||
|
@ -66,7 +66,6 @@ public:
|
|||||||
// get info about the display
|
// get info about the display
|
||||||
virtual unsigned int GetDisplayScreenCount();
|
virtual unsigned int GetDisplayScreenCount();
|
||||||
virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen );
|
virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen );
|
||||||
virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen );
|
|
||||||
virtual OUString GetDisplayScreenName( unsigned int nScreen );
|
virtual OUString GetDisplayScreenName( unsigned int nScreen );
|
||||||
|
|
||||||
virtual int ShowNativeDialog( const OUString& rTitle,
|
virtual int ShowNativeDialog( const OUString& rTitle,
|
||||||
|
@ -78,14 +78,6 @@ public:
|
|||||||
size: size of the screen
|
size: size of the screen
|
||||||
*/
|
*/
|
||||||
virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ) = 0;
|
virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ) = 0;
|
||||||
/* Gets position and size of the work area of a screen attached to the display
|
|
||||||
|
|
||||||
@param nScreen
|
|
||||||
The screen number to be queried
|
|
||||||
|
|
||||||
@returns position and size relative to the scree
|
|
||||||
*/
|
|
||||||
virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen ) = 0;
|
|
||||||
/* Gets the name of a screen
|
/* Gets the name of a screen
|
||||||
|
|
||||||
@param nScreen
|
@param nScreen
|
||||||
|
@ -31,7 +31,6 @@ public:
|
|||||||
virtual unsigned int GetDisplayBuiltInScreen();
|
virtual unsigned int GetDisplayBuiltInScreen();
|
||||||
virtual OUString GetDisplayScreenName (unsigned int nScreen);
|
virtual OUString GetDisplayScreenName (unsigned int nScreen);
|
||||||
virtual Rectangle GetDisplayScreenPosSizePixel (unsigned int nScreen);
|
virtual Rectangle GetDisplayScreenPosSizePixel (unsigned int nScreen);
|
||||||
virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel (unsigned int nScreen);
|
|
||||||
virtual int ShowNativeDialog (const OUString& rTitle,
|
virtual int ShowNativeDialog (const OUString& rTitle,
|
||||||
const OUString& rMessage,
|
const OUString& rMessage,
|
||||||
const std::list< OUString >& rButtons,
|
const std::list< OUString >& rButtons,
|
||||||
|
@ -37,7 +37,6 @@ public:
|
|||||||
virtual bool IsUnifiedDisplay();
|
virtual bool IsUnifiedDisplay();
|
||||||
virtual unsigned int GetDisplayBuiltInScreen();
|
virtual unsigned int GetDisplayBuiltInScreen();
|
||||||
virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen );
|
virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen );
|
||||||
virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen );
|
|
||||||
virtual OUString GetDisplayScreenName( unsigned int nScreen );
|
virtual OUString GetDisplayScreenName( unsigned int nScreen );
|
||||||
virtual int ShowNativeDialog( const OUString& rTitle,
|
virtual int ShowNativeDialog( const OUString& rTitle,
|
||||||
const OUString& rMessage,
|
const OUString& rMessage,
|
||||||
|
@ -33,19 +33,16 @@ class WinSalSystem : public SalSystem
|
|||||||
OUString m_aName;
|
OUString m_aName;
|
||||||
OUString m_aDeviceName;
|
OUString m_aDeviceName;
|
||||||
Rectangle m_aArea;
|
Rectangle m_aArea;
|
||||||
Rectangle m_aWorkArea;
|
|
||||||
sal_Int32 m_nStateFlags;
|
sal_Int32 m_nStateFlags;
|
||||||
|
|
||||||
DisplayMonitor() : m_nStateFlags( 0 ) {}
|
DisplayMonitor() : m_nStateFlags( 0 ) {}
|
||||||
DisplayMonitor( const OUString& rName,
|
DisplayMonitor( const OUString& rName,
|
||||||
const OUString& rDevName,
|
const OUString& rDevName,
|
||||||
const Rectangle& rArea,
|
const Rectangle& rArea,
|
||||||
const Rectangle& rWorkArea,
|
|
||||||
DWORD nStateFlags )
|
DWORD nStateFlags )
|
||||||
: m_aName( rName ),
|
: m_aName( rName ),
|
||||||
m_aDeviceName( rDevName ),
|
m_aDeviceName( rDevName ),
|
||||||
m_aArea( rArea ),
|
m_aArea( rArea ),
|
||||||
m_aWorkArea( rWorkArea ),
|
|
||||||
m_nStateFlags( nStateFlags )
|
m_nStateFlags( nStateFlags )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -62,7 +59,6 @@ public:
|
|||||||
virtual unsigned int GetDisplayScreenCount();
|
virtual unsigned int GetDisplayScreenCount();
|
||||||
virtual unsigned int GetDisplayBuiltInScreen();
|
virtual unsigned int GetDisplayBuiltInScreen();
|
||||||
virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen );
|
virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen );
|
||||||
virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen );
|
|
||||||
virtual OUString GetDisplayScreenName( unsigned int nScreen );
|
virtual OUString GetDisplayScreenName( unsigned int nScreen );
|
||||||
virtual int ShowNativeMessageBox( const OUString& rTitle,
|
virtual int ShowNativeMessageBox( const OUString& rTitle,
|
||||||
const OUString& rMessage,
|
const OUString& rMessage,
|
||||||
|
@ -1322,12 +1322,6 @@ Rectangle Application::GetScreenPosSizePixel( unsigned int nScreen )
|
|||||||
return pSys ? pSys->GetDisplayScreenPosSizePixel( nScreen ) : Rectangle();
|
return pSys ? pSys->GetDisplayScreenPosSizePixel( nScreen ) : Rectangle();
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle Application::GetWorkAreaPosSizePixel( unsigned int nScreen )
|
|
||||||
{
|
|
||||||
SalSystem* pSys = ImplGetSalSystem();
|
|
||||||
return pSys ? pSys->GetDisplayScreenWorkAreaPosSizePixel( nScreen ) : Rectangle();
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
unsigned long calcDistSquare( const Point& i_rPoint, const Rectangle& i_rRect )
|
unsigned long calcDistSquare( const Point& i_rPoint, const Rectangle& i_rRect )
|
||||||
{
|
{
|
||||||
|
@ -3710,7 +3710,7 @@ sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong
|
|||||||
if( ! pDeskW )
|
if( ! pDeskW )
|
||||||
pDeskW = pWindow;
|
pDeskW = pWindow;
|
||||||
Point aDesktopTL( pDeskW->OutputToAbsoluteScreenPixel( aRect.TopLeft() ) );
|
Point aDesktopTL( pDeskW->OutputToAbsoluteScreenPixel( aRect.TopLeft() ) );
|
||||||
nMaxHeight = Application::GetWorkAreaPosSizePixel(
|
nMaxHeight = Application::GetScreenPosSizePixel(
|
||||||
Application::GetBestScreen( Rectangle( aDesktopTL, aRect.GetSize() ) )
|
Application::GetBestScreen( Rectangle( aDesktopTL, aRect.GetSize() ) )
|
||||||
).GetHeight();
|
).GetHeight();
|
||||||
}
|
}
|
||||||
|
@ -246,14 +246,6 @@ Rectangle GtkSalSystem::GetDisplayScreenPosSizePixel (unsigned int nScreen)
|
|||||||
return Rectangle (Point(aRect.x, aRect.y), Size(aRect.width, aRect.height));
|
return Rectangle (Point(aRect.x, aRect.y), Size(aRect.width, aRect.height));
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle GtkSalSystem::GetDisplayScreenWorkAreaPosSizePixel (unsigned int nScreen)
|
|
||||||
{
|
|
||||||
// FIXME: in theory we need extra code here to collect
|
|
||||||
// the work area, ignoring fixed panels etc. on the screen.
|
|
||||||
// surely gtk+ should have API to get this for us (?)
|
|
||||||
return GetDisplayScreenPosSizePixel( nScreen );
|
|
||||||
}
|
|
||||||
|
|
||||||
OUString GtkSalSystem::GetDisplayScreenName(unsigned int nScreen)
|
OUString GtkSalSystem::GetDisplayScreenName(unsigned int nScreen)
|
||||||
{
|
{
|
||||||
gchar *pStr;
|
gchar *pStr;
|
||||||
|
@ -84,12 +84,6 @@ Rectangle X11SalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
|
|||||||
return aRet;
|
return aRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle X11SalSystem::GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen )
|
|
||||||
{
|
|
||||||
// FIXME: workareas
|
|
||||||
return GetDisplayScreenPosSizePixel( nScreen );
|
|
||||||
}
|
|
||||||
|
|
||||||
OUString X11SalSystem::GetDisplayScreenName( unsigned int nScreen )
|
OUString X11SalSystem::GetDisplayScreenName( unsigned int nScreen )
|
||||||
{
|
{
|
||||||
OUString aScreenName;
|
OUString aScreenName;
|
||||||
|
@ -73,10 +73,6 @@ sal_Bool WinSalSystem::handleMonitorCallback( sal_IntPtr hMonitor, sal_IntPtr, s
|
|||||||
aInfo.rcMonitor.top ),
|
aInfo.rcMonitor.top ),
|
||||||
Size( aInfo.rcMonitor.right - aInfo.rcMonitor.left,
|
Size( aInfo.rcMonitor.right - aInfo.rcMonitor.left,
|
||||||
aInfo.rcMonitor.bottom - aInfo.rcMonitor.top ) );
|
aInfo.rcMonitor.bottom - aInfo.rcMonitor.top ) );
|
||||||
rMon.m_aWorkArea = Rectangle( Point( aInfo.rcWork.left,
|
|
||||||
aInfo.rcWork.top ),
|
|
||||||
Size( aInfo.rcWork.right - aInfo.rcWork.left,
|
|
||||||
aInfo.rcWork.bottom - aInfo.rcWork.top ) );
|
|
||||||
if( (aInfo.dwFlags & MONITORINFOF_PRIMARY) != 0 )
|
if( (aInfo.dwFlags & MONITORINFOF_PRIMARY) != 0 )
|
||||||
m_nPrimary = it->second;
|
m_nPrimary = it->second;
|
||||||
}
|
}
|
||||||
@ -103,14 +99,9 @@ bool WinSalSystem::initMonitors()
|
|||||||
m_aMonitors.push_back( DisplayMonitor( OUString(),
|
m_aMonitors.push_back( DisplayMonitor( OUString(),
|
||||||
OUString(),
|
OUString(),
|
||||||
Rectangle( Point(), Size( w, h ) ),
|
Rectangle( Point(), Size( w, h ) ),
|
||||||
Rectangle( Point(), Size( w, h ) ),
|
|
||||||
0 ) );
|
0 ) );
|
||||||
m_aDeviceNameToMonitor[ OUString() ] = 0;
|
m_aDeviceNameToMonitor[ OUString() ] = 0;
|
||||||
m_nPrimary = 0;
|
m_nPrimary = 0;
|
||||||
RECT aWorkRect;
|
|
||||||
if( SystemParametersInfo( SPI_GETWORKAREA, 0, &aWorkRect, 0 ) )
|
|
||||||
m_aMonitors.back().m_aWorkArea = Rectangle( aWorkRect.left, aWorkRect.top,
|
|
||||||
aWorkRect.right, aWorkRect.bottom );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -135,7 +126,6 @@ bool WinSalSystem::initMonitors()
|
|||||||
m_aMonitors.push_back( DisplayMonitor( aDeviceString,
|
m_aMonitors.push_back( DisplayMonitor( aDeviceString,
|
||||||
aDeviceName,
|
aDeviceName,
|
||||||
Rectangle(),
|
Rectangle(),
|
||||||
Rectangle(),
|
|
||||||
aDev.StateFlags ) );
|
aDev.StateFlags ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -182,12 +172,6 @@ Rectangle WinSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
|
|||||||
return (nScreen < m_aMonitors.size()) ? m_aMonitors[nScreen].m_aArea : Rectangle();
|
return (nScreen < m_aMonitors.size()) ? m_aMonitors[nScreen].m_aArea : Rectangle();
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle WinSalSystem::GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen )
|
|
||||||
{
|
|
||||||
initMonitors();
|
|
||||||
return (nScreen < m_aMonitors.size()) ? m_aMonitors[nScreen].m_aWorkArea : Rectangle();
|
|
||||||
}
|
|
||||||
|
|
||||||
OUString WinSalSystem::GetDisplayScreenName( unsigned int nScreen )
|
OUString WinSalSystem::GetDisplayScreenName( unsigned int nScreen )
|
||||||
{
|
{
|
||||||
initMonitors();
|
initMonitors();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user