2006-07-05 12:30:03 +00:00
|
|
|
/*****************************************************************
|
|
|
|
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.
|
|
|
|
******************************************************************/
|
|
|
|
|
2006-10-29 19:23:45 +00:00
|
|
|
/*
|
|
|
|
This is very simple compositing code using only plain X. It doesn't use any effects
|
|
|
|
or anything like that, it merely draws everything as it would be visible without
|
|
|
|
compositing. It was the first compositing code in KWin and is usable only for testing
|
|
|
|
and as the very simple "this is how it works".
|
|
|
|
*/
|
|
|
|
|
2006-07-05 12:30:03 +00:00
|
|
|
#include "scene_basic.h"
|
|
|
|
|
|
|
|
#include "utils.h"
|
|
|
|
#include "client.h"
|
|
|
|
|
|
|
|
namespace KWinInternal
|
|
|
|
{
|
|
|
|
|
|
|
|
SceneBasic::SceneBasic( Workspace* ws )
|
|
|
|
: Scene( ws )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SceneBasic::~SceneBasic()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2006-09-30 15:40:03 +00:00
|
|
|
void SceneBasic::paint( QRegion, ToplevelList windows )
|
2006-07-05 12:30:03 +00:00
|
|
|
{
|
|
|
|
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())
|
|
|
|
{
|
2007-01-12 23:21:36 +00:00
|
|
|
Pixmap pix = (*it)->windowPixmap();
|
2007-02-27 16:13:34 +00:00
|
|
|
if( pix == None )
|
|
|
|
continue;
|
2006-10-07 21:20:23 +00:00
|
|
|
XCopyArea( display(), pix, composite_pixmap, gc,
|
2006-07-05 12:30:03 +00:00
|
|
|
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());
|
|
|
|
}
|
|
|
|
|
2006-10-29 19:23:45 +00:00
|
|
|
// These functions are not used at all, SceneBasic
|
|
|
|
// is not using inherited functionality.
|
|
|
|
|
2006-10-16 21:06:34 +00:00
|
|
|
void SceneBasic::paintBackground( QRegion )
|
|
|
|
{
|
2006-10-29 19:23:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SceneBasic::windowGeometryShapeChanged( Toplevel* )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void SceneBasic::windowOpacityChanged( Toplevel* )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void SceneBasic::windowAdded( Toplevel* )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-01-22 22:51:30 +00:00
|
|
|
void SceneBasic::windowClosed( Toplevel*, Deleted* )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void SceneBasic::windowDeleted( Deleted* )
|
2006-10-29 19:23:45 +00:00
|
|
|
{
|
2006-10-16 21:06:34 +00:00
|
|
|
}
|
|
|
|
|
2006-07-05 12:30:03 +00:00
|
|
|
} // namespace
|