Kaydet (Commit) 1806769e authored tarafından Rüdiger Timm's avatar Rüdiger Timm

INTEGRATION: CWS vcl85_SRC680 (1.219.94); FILE MERGED

2007/12/13 12:06:34 pl 1.219.94.2: #i81311# limit to screen size only sizeable windows
2007/12/12 15:36:41 pl 1.219.94.1: #i84399# add DPMS extension support (thanks cosine)
üst 7bf89fd6
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: salframe.cxx,v $ * $RCSfile: salframe.cxx,v $
* *
* $Revision: 1.220 $ * $Revision: 1.221 $
* *
* last change: $Author: ihi $ $Date: 2008-01-14 16:25:31 $ * last change: $Author: rt $ $Date: 2008-01-29 16:23:42 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include <X11/keysym.h> #include <X11/keysym.h>
#include <FWS.hxx> #include <FWS.hxx>
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>
#include <X11/extensions/dpms.h>
#include <postx.h> #include <postx.h>
#include <salunx.h> #include <salunx.h>
...@@ -2261,7 +2262,18 @@ void X11SalFrame::StartPresentation( BOOL bStart ) ...@@ -2261,7 +2262,18 @@ void X11SalFrame::StartPresentation( BOOL bStart )
if( ! bStart && hPresentationWindow != None ) if( ! bStart && hPresentationWindow != None )
doReparentPresentationDialogues( GetDisplay() ); doReparentPresentationDialogues( GetDisplay() );
hPresentationWindow = (bStart && IsOverrideRedirect() ) ? GetWindow() : None; hPresentationWindow = (bStart && IsOverrideRedirect() ) ? GetWindow() : None;
if( bStart || nScreenSaversTimeout_ )
// needs static here to save DPMS settings
int dummy;
static XLIB_BOOL DPMSEnabled = false;
static bool DPMSExtensionAvailable = (DPMSQueryExtension(GetXDisplay(), &dummy, &dummy) != 0);
static CARD16 dpms_standby_timeout=0;
static CARD16 dpms_suspend_timeout=0;
static CARD16 dpms_off_timeout=0;
if( bStart || nScreenSaversTimeout_ || DPMSEnabled)
{ {
if( hPresentationWindow ) if( hPresentationWindow )
{ {
...@@ -2277,24 +2289,60 @@ void X11SalFrame::StartPresentation( BOOL bStart ) ...@@ -2277,24 +2289,60 @@ void X11SalFrame::StartPresentation( BOOL bStart )
&interval, &interval,
&prefer_blanking, &prefer_blanking,
&allow_exposures ); &allow_exposures );
if( !bStart )
// get the DPMS state right before the start
if (DPMSExtensionAvailable)
{
CARD16 state; // card16 is defined in Xdm.h
DPMSInfo( GetXDisplay(),
&state,
&DPMSEnabled);
}
if( bStart ) // start show
{
if ( timeout )
{ {
nScreenSaversTimeout_ = timeout;
XResetScreenSaver( GetXDisplay() );
XSetScreenSaver( GetXDisplay(), XSetScreenSaver( GetXDisplay(),
nScreenSaversTimeout_, 0,
interval, interval,
prefer_blanking, prefer_blanking,
allow_exposures ); allow_exposures );
nScreenSaversTimeout_ = 0;
} }
else if( timeout ) if( DPMSEnabled )
{
if ( DPMSExtensionAvailable )
{
DPMSGetTimeouts( GetXDisplay(),
&dpms_standby_timeout,
&dpms_suspend_timeout,
&dpms_off_timeout);
DPMSSetTimeouts(GetXDisplay(), 0,0,0);
}
}
}
else // if( !bStart ) // end of show
{
if( nScreenSaversTimeout_ )
{ {
nScreenSaversTimeout_ = timeout;
XResetScreenSaver( GetXDisplay() );
XSetScreenSaver( GetXDisplay(), XSetScreenSaver( GetXDisplay(),
0, nScreenSaversTimeout_,
interval, interval,
prefer_blanking, prefer_blanking,
allow_exposures ); allow_exposures );
nScreenSaversTimeout_ = 0;
}
if ( DPMSEnabled )
{
if ( DPMSExtensionAvailable )
{
// restore timeouts
DPMSSetTimeouts(GetXDisplay(), dpms_standby_timeout,
dpms_suspend_timeout, dpms_off_timeout);
}
}
} }
} }
} }
...@@ -3718,9 +3766,13 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent ) ...@@ -3718,9 +3766,13 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent )
maGeometry.nHeight = h; maGeometry.nHeight = h;
} }
// limit width and height if we are too large: #47757 // limit width and height if we are too large: #47757
// olwm and fvwm need this, it doesnt harm the rest // olwm and fvwm need this, it doesnt harm the rest
// #i81311# do this only for sizable frames
if( (nStyle_ & SAL_FRAME_STYLE_SIZEABLE) != 0 )
{
Size aScreenSize = GetDisplay()->GetScreenSize( m_nScreen ); Size aScreenSize = GetDisplay()->GetScreenSize( m_nScreen );
int nScreenWidth = aScreenSize.Width(); int nScreenWidth = aScreenSize.Width();
int nScreenHeight = aScreenSize.Height(); int nScreenHeight = aScreenSize.Height();
...@@ -3736,9 +3788,11 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent ) ...@@ -3736,9 +3788,11 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent )
if (nFrameHeight > nScreenHeight) if (nFrameHeight > nScreenHeight)
aSize.Height() = nScreenHeight - maGeometry.nBottomDecoration - maGeometry.nTopDecoration; aSize.Height() = nScreenHeight - maGeometry.nBottomDecoration - maGeometry.nTopDecoration;
SetSize (aSize); SetSize( aSize );
bResized = false;
}
} }
else if( bResized ) if( bResized )
CallCallback( SALEVENT_RESIZE, NULL ); CallCallback( SALEVENT_RESIZE, NULL );
GetDisplay()->GetXLib()->PopXErrorLevel(); GetDisplay()->GetXLib()->PopXErrorLevel();
......
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