And add a silly moving-in animation for new windows.

Now it's time to add plugins interface so that people who can
do this for real do it.


svn path=/branches/work/kwin_composite/; revision=558173
This commit is contained in:
Luboš Luňák 2006-07-04 20:07:58 +00:00
parent c2e60957d5
commit 157372f2e7
4 changed files with 24 additions and 4 deletions

View file

@ -89,7 +89,8 @@ Client::Client( Workspace *ws )
border_bottom( 0 ),
sm_stacking_order( -1 ),
demandAttentionKNotifyTimer( NULL ),
damage( None )
damage( None ),
appear_stage( 0 )
// SELI do all as initialization
{
autoRaiseTimer = 0;

View file

@ -296,6 +296,9 @@ class Client
void setShapable(bool b);
bool hasStrut() const;
int appearStage() const { return appear_stage; }
void appearStep() { if (appear_stage > 0 ) --appear_stage; }
private slots:
void autoRaise();
void shadeHover();
@ -543,6 +546,7 @@ class Client
bool isBMP_;
QTimer* demandAttentionKNotifyTimer;
Damage damage;
int appear_stage;
};
// helper for Client::postponeGeometryUpdates() being called in pairs (true/false)

View file

@ -52,6 +52,17 @@ void Workspace::setDamaged()
void Workspace::compositeTimeout()
{
bool effect = false;
for( ClientList::ConstIterator it = clients.begin();
it != clients.end();
++it )
{
if( (*it)->appearStage())
{
effect = true;
(*it)->appearStep();
}
}
#define EFF
#ifdef EFF
const int SPD = 10;
@ -61,10 +72,10 @@ void Workspace::compositeTimeout()
if( cnt == 8 * SPD )
cnt = 0;
int s = cnt / SPD;
if( !damaged && s == olds )
if( !damaged && s == olds && !effect )
return;
#else
if( !damaged )
if( !damaged && !effect )
return;
#endif
XGCValues val;
@ -84,7 +95,10 @@ void Workspace::compositeTimeout()
it != stackingOrder().end();
++it )
{
QRect r = (*it)->geometry().intersect( QRect( 0, 0, displayWidth(), displayHeight()));
QRect r = (*it)->geometry();
if( (*it)->appearStage())
r.setHeight( r.height() * ( 20 - (*it)->appearStage()) / 20 );
r = r.intersect( QRect( 0, 0, displayWidth(), displayHeight()));
if( !r.isEmpty())
{
XCopyArea( display(), (*it)->windowPixmap(), composite_pixmap, gc,

View file

@ -54,6 +54,7 @@ bool Client::manage( Window w, bool isMapped )
embedClient( w, attr );
setupCompositing();
appear_stage = 20;
// SELI order all these things in some sane manner