Use a different iconify/restore style to the default, because the

default is too slow and flickery.

svn path=/trunk/kdebase/kwin/; revision=67690
icc-effect-5.14.5
Rik Hemsley 2000-10-14 23:45:05 +00:00
parent 6ff8139d9e
commit b8e9f83e81
2 changed files with 47 additions and 0 deletions

View File

@ -20,10 +20,14 @@
Boston, MA 02111-1307, USA.
*/
#include <unistd.h> // for usleep
#include <qpainter.h>
#include <qimage.h>
#include <qlayout.h>
#include <netwm.h>
#include "../../options.h"
#include "../../workspace.h"
@ -319,6 +323,48 @@ Manager::slotHelp()
contextHelp();
}
void
Manager::animateIconifyOrDeiconify(bool iconify)
{
NETRect r = netWinInfo()->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() );
}
} // End namespace

View File

@ -73,6 +73,7 @@ class Manager : public Client
void paintEvent(QPaintEvent *);
void resizeEvent(QResizeEvent *);
void mouseDoubleClickEvent(QMouseEvent *);
void animateIconifyOrDeiconify(bool);
protected slots: