David Fraser wrote:
Philipp Lohmann - Sun Germany wrote:
The fullscreen presentation seems to be the most important issue
however. For this case I'd propose to add a parameter to the
WorkWindow::ShowFullScreenMode method, e.g.
ShowFullScreen( BOOL bFullScreen, SHORT nScreen = -1 );
The default for the screen number to -1 should produce the current
behaviour (meaning do nothing special).
OK that sounds good.
OK I've done a patch that does the above suggestion, and actually finds
the numbered screen on Windows.
The header files etc are adjusted for aqua but that's all for now.
I looked at the unx salframe.cxx code and interestingly there is already
some Xinerama code there to work out which screen to create the window
on based on the current mouse cursor position in X11SalFrame::Init.
I wrote up a stub of a patch that uses XMoveResizeDisplay (commented
out) in ShowFullScreen but I have no experience of Xinerama coding and
no machine to test on atm so its just an idea (also from looking at the
wxWidgets Xinerama code).
On the next step: it seems the ShowFullScreen gets called from
WorkWindow::StartPresentationMode when nFlags doesn't contain
PRESENTATION_NOFULLSCREEN. But there would then be no way to pass the
screen number into StartPresentationMode. So either this needs another
parameter or there needs to be another way to pass in the value. Since
the sd code seems to have access to the SalFrame object, should this be
done in there?
Of course when we have a UNO component for querying displays then the
code to actually find a select the display should use that... and the UI
for selecting the display should use it too.
In this case the screen number could be replaced with an identifying
string if neccessary, but this should be fairly easy.
Patch attached since I'm on a plane so issuezilla is *definitely* not
possible :-)
David
--- vcl/aqua/source/window/salframe.cxx Wed Nov 30 21:26:40 2005
+++ vcl/aqua/source/window/salframe.cxx.orig Fri Sep 09 12:45:20 2005
@@ -247,7 +247,7 @@
// -----------------------------------------------------------------------
-void SalFrame::ShowFullScreen( BOOL bFullScreen, SHORT nScreen )
+void SalFrame::ShowFullScreen( BOOL bFullScreen )
{
}
--- vcl/inc/salframe.hxx Wed Nov 30 21:24:22 2005
+++ vcl/inc/salframe.hxx.orig Fri Sep 09 13:18:54 2005
@@ -207,7 +207,7 @@
const SalFrameGeometry& GetUnmirroredGeometry() const { return maGeometry; }
virtual void SetWindowState( const SalFrameState* pState ) = 0;
virtual BOOL GetWindowState( SalFrameState* pState ) = 0;
- virtual void ShowFullScreen( BOOL bFullScreen, SHORT nScreen = -1 ) = 0;
+ virtual void ShowFullScreen( BOOL bFullScreen ) = 0;
// Enable/Disable ScreenSaver, SystemAgents, ...
virtual void StartPresentation( BOOL bStart ) = 0;
// Show Window over all other Windows
--- vcl/unx/inc/salframe.h Wed Nov 30 21:25:01 2005
+++ vcl/unx/inc/salframe.h.orig Fri Sep 09 14:44:35 2005
@@ -233,7 +233,7 @@
virtual SalFrame* GetParent() const;
virtual void SetWindowState( const SalFrameState* pState );
virtual BOOL GetWindowState( SalFrameState* pState );
- virtual void ShowFullScreen( BOOL bFullScreen, SHORT nScreen = -1 );
+ virtual void ShowFullScreen( BOOL bFullScreen );
virtual void StartPresentation( BOOL bStart );
virtual void SetAlwaysOnTop( BOOL bOnTop );
virtual void ToTop( USHORT nFlags );
--- vcl/unx/source/window/salframe.cxx Wed Nov 30 22:10:54 2005
+++ vcl/unx/source/window/salframe.cxx.orig Wed Oct 05 12:28:51 2005
@@ -1891,24 +1891,10 @@
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalFrame::ShowFullScreen( BOOL bFullScreen, SHORT nScreen )
+void X11SalFrame::ShowFullScreen( BOOL bFullScreen )
{
if( mbFullScreen == (bool)bFullScreen )
return;
- if (nScreen >= 0)
- {
- if( GetDisplay()->IsXinerama() )
- {
- const std::vector< Rectangle >& rScreens = GetDisplay()->GetXineramaScreens();
- if (nScreen < rScreens.size())
- {
- Rectangle &rScreen = rScreens[i];
- // TODO display on the given screen
- // this probable requires GetShellWindow and GetWindow - see other MoveResizes
- // XMoveResizeWindow( GetXDisplay(), GetWindow(), r.Left(), r.Top(), r.GetWidth(), r.GetHeight() );
- }
- }
- }
pDisplay_->getWMAdaptor()->showFullScreen( this, bFullScreen );
if( IsOverrideRedirect()
--- vcl/win/inc/salframe.h Wed Nov 30 21:25:24 2005
+++ vcl/win/inc/salframe.h.orig Fri Sep 09 15:55:48 2005
@@ -123,7 +123,7 @@
virtual SalFrame* GetParent() const;
virtual void SetWindowState( const SalFrameState* pState );
virtual BOOL GetWindowState( SalFrameState* pState );
- virtual void ShowFullScreen( BOOL bFullScreen, SHORT nScreen = -1 );
+ virtual void ShowFullScreen( BOOL bFullScreen );
virtual void StartPresentation( BOOL bStart );
virtual void SetAlwaysOnTop( BOOL bOnTop );
virtual void ToTop( USHORT nFlags );
--- vcl/win/source/window/salframe.cxx Wed Nov 30 21:35:00 2005
+++ vcl/win/source/window/salframe.cxx.orig Fri Sep 09 16:08:44 2005
@@ -266,8 +266,8 @@
// calculates the work area taking multiple monitors into account
if( winVerOk )
{
- static int nScreens = GetSystemMetrics( SM_CMONITORS );
- if( nScreens == 1 )
+ static int nMonitors = GetSystemMetrics( SM_CMONITORS );
+ if( nMonitors == 1 )
{
if( bIgnoreTaskbar )
{
@@ -857,22 +857,9 @@
}
// -----------------------------------------------------------------------
-static BOOL CALLBACK CalcFullScreenSizeMonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
-{
- MONITORINFOEX **lpmicallback;
- MONITORINFOEX *lpmithis;
- lpmicallback = (MONITORINFOEX **)dwData;
- lpmithis = *lpmicallback;
- lpmithis->cbSize = sizeof(MONITORINFOEX);
- if (GetMonitorInfo(hMonitor, lpmithis))
- {
- *lpmicallback = lpmithis + sizeof(MONITORINFOEX);
- }
- return TRUE;
-};
static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame,
- int& rX, int& rY, int& rDX, int& rDY, SHORT nScreen = -1 )
+ int& rX, int& rY, int& rDX, int& rDY )
{
// set window to screen size
int nFrameX;
@@ -880,10 +867,6 @@
int nCaptionY;
int nScreenDX;
int nScreenDY;
- int nScreenX;
- int nScreenY;
- BOOL bFoundScreen;
- int nScreens;
if ( pFrame->mbSizeBorder )
{
@@ -910,48 +893,18 @@
else
nCaptionY = 0;
- bFoundScreen = FALSE;
- if ( nScreen >= 0 )
- {
- nScreens = GetSystemMetrics(SM_CMONITORS);
- MONITORINFOEX *lpmiarray = (MONITORINFOEX *)malloc(sizeof(MONITORINFOEX) * nScreens);
- if (lpmiarray != NULL)
- {
- MONITORINFOEX *lpmicurrent = lpmiarray;
- POINT ptCunning;
- if (EnumDisplayMonitors(NULL, NULL, &CalcFullScreenSizeMonitorEnumProc, (LPARAM)(&lpmicurrent)))
- {
- nScreens = (lpmicurrent - lpmiarray) / sizeof(MONITORINFOEX);
- if (nScreen < nScreens)
- {
- MONITORINFOEX *mInfo = lpmiarray + nScreen * sizeof(MONITORINFOEX);
- nScreenX = mInfo->rcMonitor.left;
- nScreenY = mInfo->rcMonitor.top;
- nScreenDX = mInfo->rcMonitor.right - nScreenX;
- nScreenDY = mInfo->rcMonitor.bottom - nScreenY;
- bFoundScreen = TRUE;
- }
- }
- free(lpmiarray);
- }
- }
- if (!bFoundScreen)
- {
- nScreenX = 0;
- nScreenY = 0;
- nScreenDX = GetSystemMetrics( SM_CXSCREEN );
- nScreenDY = GetSystemMetrics( SM_CYSCREEN );
- }
+ nScreenDX = GetSystemMetrics( SM_CXSCREEN );
+ nScreenDY = GetSystemMetrics( SM_CYSCREEN );
- rX = nScreenX-nFrameX;
- rY = nScreenY-(nFrameY+nCaptionY);
+ rX = -nFrameX;
+ rY = -(nFrameY+nCaptionY);
rDX = nScreenDX+(nFrameX*2);
rDY = nScreenDY+(nFrameY*2)+nCaptionY;
}
// -----------------------------------------------------------------------
-static void ImplSalFrameFullScreenPos( WinSalFrame* pFrame, BOOL bAlways = FALSE, SHORT nScreen = -1 )
+static void ImplSalFrameFullScreenPos( WinSalFrame* pFrame, BOOL bAlways = FALSE )
{
if ( bAlways || !IsIconic( pFrame->mhWnd ) )
{
@@ -960,7 +913,7 @@
int nY;
int nWidth;
int nHeight;
- ImplSalCalcFullScreenSize( pFrame, nX, nY, nWidth, nHeight, nScreen );
+ ImplSalCalcFullScreenSize( pFrame, nX, nY, nWidth, nHeight );
SetWindowPos( pFrame->mhWnd, 0,
nX, nY, nWidth, nHeight,
SWP_NOZORDER | SWP_NOACTIVATE );
@@ -1964,7 +1917,7 @@
// -----------------------------------------------------------------------
-void WinSalFrame::ShowFullScreen( BOOL bFullScreen, SHORT nScreen )
+void WinSalFrame::ShowFullScreen( BOOL bFullScreen )
{
if ( mbFullScreen == bFullScreen )
return;
@@ -1989,7 +1942,7 @@
mnShowState = SW_SHOW;
// set window to screen size
- ImplSalFrameFullScreenPos( this, TRUE, nScreen );
+ ImplSalFrameFullScreenPos( this, TRUE );
}
else
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]