[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:05:54
Message-ID: 1152043554.935142.15687.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 558171 by lunakl:

Add a silly snowing-like effect to windows so that it's visible
there's something going on.



 M  +28 -0     composite.cpp  


--- branches/work/kwin_composite/composite.cpp #558170:558171
@@ -52,13 +52,34 @@
     
 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 )
         return;
+#endif
     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()); +#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();
          it != stackingOrder().end();
          ++it )
@@ -68,6 +89,9 @@
             {
             XCopyArea( display(), (*it)->windowPixmap(), composite_pixmap, gc,
                 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();
@@ -80,6 +104,10 @@
                 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 ); +#ifdef EFF
+    XFreePixmap( display(), val.stipple );
+    XFreeGC( display(), gc2 );
+#endif
     XFreeGC( display(), gc );
     XFlush( display());
     damaged = false;


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

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