Don't do any compositing when nothing is visible anyway (e.g. when switched
away from the X session). svn path=/trunk/KDE/kdebase/workspace/; revision=726713
This commit is contained in:
parent
745d101733
commit
0e55f109c5
4 changed files with 14 additions and 2 deletions
|
@ -271,7 +271,8 @@ void Workspace::performCompositing()
|
|||
if( lastCompositePaint.elapsed() < 1 )
|
||||
return;
|
||||
checkCursorPos();
|
||||
if( repaints_region.isEmpty() && !windowRepaintsPending()) // no damage
|
||||
if(( repaints_region.isEmpty() && !windowRepaintsPending()) // no damage
|
||||
|| !overlay_visible ) // nothing is visible anyway
|
||||
{
|
||||
scene->idle();
|
||||
return;
|
||||
|
@ -365,6 +366,7 @@ void Workspace::setupOverlay( Window w )
|
|||
XMapWindow( display(), w );
|
||||
}
|
||||
XMapRaised( display(), overlay );
|
||||
XSelectInput( display(), overlay, VisibilityChangeMask );
|
||||
}
|
||||
|
||||
void Workspace::destroyOverlay()
|
||||
|
|
10
events.cpp
10
events.cpp
|
@ -455,8 +455,16 @@ bool Workspace::workspaceEvent( XEvent * e )
|
|||
return true;
|
||||
break;
|
||||
case Expose:
|
||||
if( e->xexpose.window == rootWindow() && compositing()) // root window needs repainting
|
||||
if( compositing()
|
||||
&& ( e->xexpose.window == rootWindow() // root window needs repainting
|
||||
|| overlay != None && e->xexpose.window == overlay )) // overlay needs repainting
|
||||
{
|
||||
addRepaint( e->xexpose.x, e->xexpose.y, e->xexpose.width, e->xexpose.height );
|
||||
}
|
||||
break;
|
||||
case VisibilityNotify:
|
||||
if( compositing() && overlay != None && e->xvisibility.window == overlay )
|
||||
overlay_visible = ( e->xvisibility.state != VisibilityFullyObscured );
|
||||
break;
|
||||
default:
|
||||
if( e->type == Extensions::randrNotifyEvent() && Extensions::randrAvailable() )
|
||||
|
|
|
@ -128,6 +128,7 @@ Workspace::Workspace( bool restore )
|
|||
cm_selection( NULL ),
|
||||
compositeRate( 0 ),
|
||||
overlay( None ),
|
||||
overlay_visible( true ),
|
||||
transSlider( NULL ),
|
||||
transButton( NULL )
|
||||
{
|
||||
|
|
|
@ -715,6 +715,7 @@ class Workspace : public QObject, public KDecorationDefines
|
|||
int compositeRate;
|
||||
QRegion repaints_region;
|
||||
Window overlay; // XComposite overlay window
|
||||
bool overlay_visible;
|
||||
QSlider *transSlider;
|
||||
QPushButton *transButton;
|
||||
|
||||
|
|
Loading…
Reference in a new issue