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

List:       kde-core-devel
Subject:    kwin patches
From:       Rik Hemsley <rik () kde ! org>
Date:       2000-09-27 11:48:53
[Download RAW message or body]

client.diff changes the iconify animation - suck it and see.
workspace.diff fixes the size of clients restored by SM

Rik

["client.diff" (text/english)]

Index: client.cpp
===================================================================
RCS file: /home/kde/kdebase/kwin/client.cpp,v
retrieving revision 1.163
diff -u -3 -p -r1.163 client.cpp
--- client.cpp	2000/09/25 22:11:27	1.163
+++ client.cpp	2000/09/27 11:46:44
@@ -2485,91 +2485,46 @@ QRect Client::adjustedClientArea( const 
 
 void Client::animateIconifyOrDeiconify( bool iconify)
 {
-    if ( blockAnimation )
-	return;
-    // the function is a bit tricky since it will ensure that an
-    // animation action needs always the same time regardless of the
-    // performance of the machine or the X-Server.
-
-    float lf,rf,tf,bf,step;
-
-    int speed = options->animateMinimizeSpeed;
-    if ( speed > 10 )
-	speed = 10;
-    if ( speed < 0 )
-	speed = 0;
-
-    step = 40. * (11 - speed );
-
-    NETRect r = info->iconGeometry();
-    QRect icongeom( r.pos.x, r.pos.y, r.size.width, r.size.height );
-    if ( !icongeom.isValid() )
-	return;
-
-    QPixmap pm = animationPixmap( iconify ? width() : icongeom.width() );
-
-    QRect before, after;
-    if ( iconify ) {
-	before = QRect( x(), y(), width(), pm.height() );
-	after = QRect( icongeom.x(), icongeom.y(), icongeom.width(), pm.height() );
-    } else {
-	before = QRect( icongeom.x(), icongeom.y(), icongeom.width(), pm.height() );
-	after = QRect( x(), y(), width(), pm.height() );
-    }
-
-    lf = (after.left() - before.left())/step;
-    rf = (after.right() - before.right())/step;
-    tf = (after.top() - before.top())/step;
-    bf = (after.bottom() - before.bottom())/step;
-
-
-    XGrabServer( qt_xdisplay() );
-
-    QRect area = before;
-    QRect area2;
-    QPixmap pm2;
-
-    QTime t;
-    t.start();
-    float diff;
-
-    QPainter p ( workspace()->desktopWidget() );
-    bool need_to_clear = FALSE;
-    QPixmap pm3;
-    do {
-	if (area2 != area){
-	    pm = animationPixmap( area.width() );
-	    pm2 = QPixmap::grabWindow( qt_xrootwin(), area.x(), area.y(), area.width(), area.height() );
-	    p.drawPixmap( area.x(), area.y(), pm );
-	    if ( need_to_clear ) {
-		p.drawPixmap( area2.x(), area2.y(), pm3 );
-		need_to_clear = FALSE;
-	    }
-	    area2 = area;
-	}
-	XFlush(qt_xdisplay());
-	XSync( qt_xdisplay(), FALSE );
-	diff = t.elapsed();
- 	if (diff > step)
- 	    diff = step;
-	area.setLeft(before.left() + int(diff*lf));
-	area.setRight(before.right() + int(diff*rf));
-	area.setTop(before.top() + int(diff*tf));
-	area.setBottom(before.bottom() + int(diff*bf));
-	if (area2 != area ) {
-	    if ( area2.intersects( area ) )
-		p.drawPixmap( area2.x(), area2.y(), pm2 );
-	    else { // no overlap, we can clear later to avoid flicker
-		pm3 = pm2;
-		need_to_clear = TRUE;
-	    }
-	}
-    } while ( t.elapsed() < step);
-    if (area2 == area || need_to_clear )
-	p.drawPixmap( area2.x(), area2.y(), pm2 );
+  if (blockAnimation)
+    return;
 
-    p.end();
-    XUngrabServer( qt_xdisplay() );
+  NETRect r = info->iconGeometry();
+
+  QRect icongeom( r.pos.x, r.pos.y, r.size.width, r.size.height );
+
+  if (!icongeom.isValid())
+    return;
+
+  QRect wingeom(x(), y(), width(), height());
+
+  XGrabServer( qt_xdisplay() );
+
+  QPainter p(workspace()->desktopWidget());
+
+  p.setRasterOp(Qt::NotROP);
+
+  if (iconify)
+    p.setClipRegion(QRegion(workspace()->desktopWidget()->rect()) - wingeom);
+
+  p.drawLine(wingeom.bottomRight(), icongeom.bottomRight());
+  p.drawLine(wingeom.bottomLeft(), icongeom.bottomLeft());
+  p.drawLine(wingeom.topLeft(), icongeom.topLeft());
+  p.drawLine(wingeom.topRight(), icongeom.topRight());
+
+  p.flush();
+
+  XSync( qt_xdisplay(), FALSE );
+
+  usleep(30000);
+
+  p.drawLine(wingeom.bottomRight(), icongeom.bottomRight());
+  p.drawLine(wingeom.bottomLeft(), icongeom.bottomLeft());
+  p.drawLine(wingeom.topLeft(), icongeom.topLeft());
+  p.drawLine(wingeom.topRight(), icongeom.topRight());
+
+  p.end();
+
+  XUngrabServer( qt_xdisplay() );
 }
 
 

["workspace.diff" (text/plain)]

Index: workspace.cpp
===================================================================
RCS file: /home/kde/kdebase/kwin/workspace.cpp,v
retrieving revision 1.171
diff -u -3 -p -r1.171 workspace.cpp
--- workspace.cpp	2000/09/25 15:30:50	1.171
+++ workspace.cpp	2000/09/27 11:47:09
@@ -2720,7 +2720,9 @@ void Workspace::storeSession( KConfig* c
 	    config->writeEntry( QString("sessionId")+n, sessionId.data() );
 	    config->writeEntry( QString("windowRole")+n, windowRole.data() );
 	    config->writeEntry( QString("wmCommand")+n, wmCommand.data() );
-	    config->writeEntry( QString("geometry")+n, c->geometry() );
+      QPoint pos = c->geometry().topLeft();
+      QSize size = c->windowWrapper()->geometry().size();
+	    config->writeEntry( QString("geometry")+n, QRect(pos, size) );
 	    config->writeEntry( QString("restore")+n, c->geometryRestore() );
 	    config->writeEntry( QString("maximize")+n, (int) c->maximizeMode() );
 	    config->writeEntry( QString("desktop")+n, c->desktop() );


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

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