[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/kwin_composite
From:       Luboš Luňák <l.lunak () kde ! org>
Date:       2006-07-04 20:08:02
Message-ID: 1152043682.268496.16153.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 558173 by lunakl:

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.



 M  +2 -1      client.cpp  
 M  +4 -0      client.h  
 M  +17 -3     composite.cpp  
 M  +1 -0      manage.cpp  


--- branches/work/kwin_composite/client.cpp #558172:558173
@@ -89,7 +89,8 @@
         border_bottom( 0 ),
         sm_stacking_order( -1 ),
         demandAttentionKNotifyTimer( NULL ),
-        damage( None )
+        damage( None ),
+        appear_stage( 0 )
 // SELI do all as initialization
     {
     autoRaiseTimer = 0;
--- branches/work/kwin_composite/client.h #558172:558173
@@ -296,6 +296,9 @@
         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 @@
         bool isBMP_;
         QTimer* demandAttentionKNotifyTimer;
         Damage damage;
+        int appear_stage;
     };
 
 // helper for Client::postponeGeometryUpdates() being called in pairs (true/false)
--- branches/work/kwin_composite/composite.cpp #558172:558173
@@ -52,6 +52,17 @@
     
 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 @@
     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 @@
          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,
--- branches/work/kwin_composite/manage.cpp #558172:558173
@@ -54,6 +54,7 @@
     embedClient( w, attr );
     
     setupCompositing();
+    appear_stage = 20;
 
     // SELI order all these things in some sane manner
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic