Add a silly snowing-like effect to windows so that it's visible
there's something going on. svn path=/branches/work/kwin_composite/; revision=558171
This commit is contained in:
parent
571ba9cf9e
commit
c2e60957d5
1 changed files with 28 additions and 0 deletions
|
@ -52,13 +52,34 @@ void Workspace::setDamaged()
|
||||||
|
|
||||||
void Workspace::compositeTimeout()
|
void Workspace::compositeTimeout()
|
||||||
{
|
{
|
||||||
|
#define EFF
|
||||||
|
#ifdef EFF
|
||||||
|
const int SPD = 10;
|
||||||
|
static int cnt = 0;
|
||||||
|
int olds = cnt / SPD;
|
||||||
|
++cnt;
|
||||||
|
if( cnt == 8 * SPD )
|
||||||
|
cnt = 0;
|
||||||
|
int s = cnt / SPD;
|
||||||
|
if( !damaged && s == olds )
|
||||||
|
return;
|
||||||
|
#else
|
||||||
if( !damaged )
|
if( !damaged )
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
XGCValues val;
|
XGCValues val;
|
||||||
val.foreground = WhitePixel( display(), DefaultScreen( display()));
|
val.foreground = WhitePixel( display(), DefaultScreen( display()));
|
||||||
val.subwindow_mode = IncludeInferiors;
|
val.subwindow_mode = IncludeInferiors;
|
||||||
GC gc = XCreateGC( display(), composite_pixmap, GCForeground | GCSubwindowMode, &val );
|
GC gc = XCreateGC( display(), composite_pixmap, GCForeground | GCSubwindowMode, &val );
|
||||||
XFillRectangle( display(), composite_pixmap, gc, 0, 0, displayWidth(), displayHeight());
|
XFillRectangle( display(), composite_pixmap, gc, 0, 0, displayWidth(), displayHeight());
|
||||||
|
#ifdef EFF
|
||||||
|
val.fill_style = FillStippled;
|
||||||
|
char data[] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x00 };
|
||||||
|
data[ s ] = 1 << s;
|
||||||
|
val.stipple = XCreateBitmapFromData( display(), rootWindow(), data, 8, 8 );
|
||||||
|
val.foreground = BlackPixel( display(), DefaultScreen( display()));
|
||||||
|
GC gc2 = XCreateGC( display(), composite_pixmap, GCForeground | GCSubwindowMode | GCFillStyle | GCStipple, &val );
|
||||||
|
#endif
|
||||||
for( ClientList::ConstIterator it = stackingOrder().begin();
|
for( ClientList::ConstIterator it = stackingOrder().begin();
|
||||||
it != stackingOrder().end();
|
it != stackingOrder().end();
|
||||||
++it )
|
++it )
|
||||||
|
@ -68,6 +89,9 @@ void Workspace::compositeTimeout()
|
||||||
{
|
{
|
||||||
XCopyArea( display(), (*it)->windowPixmap(), composite_pixmap, gc,
|
XCopyArea( display(), (*it)->windowPixmap(), composite_pixmap, gc,
|
||||||
qMax( 0, -(*it)->x()), qMax( 0, -(*it)->y()), r.width(), r.height(), r.x(), r.y());
|
qMax( 0, -(*it)->x()), qMax( 0, -(*it)->y()), r.width(), r.height(), r.x(), r.y());
|
||||||
|
#ifdef EFF
|
||||||
|
XFillRectangle( display(), composite_pixmap, gc2, r.x(), r.y(), r.width(), r.height());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for( UnmanagedList::ConstIterator it = unmanaged.begin();
|
for( UnmanagedList::ConstIterator it = unmanaged.begin();
|
||||||
|
@ -80,6 +104,10 @@ void Workspace::compositeTimeout()
|
||||||
qMax( 0, -(*it)->x()), qMax( 0, -(*it)->y()), r.width(), r.height(), r.x(), r.y());
|
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 );
|
XCopyArea( display(), composite_pixmap, rootWindow(), gc, 0, 0, displayWidth(), displayHeight(), 0, 0 );
|
||||||
|
#ifdef EFF
|
||||||
|
XFreePixmap( display(), val.stipple );
|
||||||
|
XFreeGC( display(), gc2 );
|
||||||
|
#endif
|
||||||
XFreeGC( display(), gc );
|
XFreeGC( display(), gc );
|
||||||
XFlush( display());
|
XFlush( display());
|
||||||
damaged = false;
|
damaged = false;
|
||||||
|
|
Loading…
Reference in a new issue