kwin/scene_basic.cpp
Luboš Luňák 649887d6c2 Looks like using XserverRegion for keeping damage regions
wasn't that good idea. Changed to QRegion.


svn path=/branches/work/kwin_composite/; revision=590648
2006-09-30 15:40:03 +00:00

57 lines
1.8 KiB
C++

/*****************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org>
You can Freely distribute this program under the GNU General Public
License. See the file "COPYING" for the exact licensing terms.
******************************************************************/
#include "scene_basic.h"
#include "utils.h"
#include "client.h"
namespace KWinInternal
{
//****************************************
// SceneBasic
//****************************************
SceneBasic::SceneBasic( Workspace* ws )
: Scene( ws )
{
}
SceneBasic::~SceneBasic()
{
}
void SceneBasic::paint( QRegion, ToplevelList windows )
{
Pixmap composite_pixmap = XCreatePixmap( display(), rootWindow(), displayWidth(), displayHeight(), QX11Info::appDepth());
XGCValues val;
val.foreground = WhitePixel( display(), DefaultScreen( display()));
val.subwindow_mode = IncludeInferiors;
GC gc = XCreateGC( display(), composite_pixmap, GCForeground | GCSubwindowMode, &val );
XFillRectangle( display(), composite_pixmap, gc, 0, 0, displayWidth(), displayHeight());
for( ToplevelList::ConstIterator it = windows.begin();
it != windows.end();
++it )
{
QRect r = (*it)->geometry().intersect( QRect( 0, 0, displayWidth(), displayHeight()));
if( !r.isEmpty())
{
XCopyArea( display(), (*it)->windowPixmap(), composite_pixmap, gc,
qMax( 0, -(*it)->x()), qMax( 0, -(*it)->y()), r.width(), r.height(), r.x(), r.y());
}
}
XCopyArea( display(), composite_pixmap, rootWindow(), gc, 0, 0, displayWidth(), displayHeight(), 0, 0 );
XFreeGC( display(), gc );
XFreePixmap( display(), composite_pixmap );
XFlush( display());
}
} // namespace