Use a different iconify/restore style to the default, because the
default is too slow and flickery. svn path=/trunk/kdebase/kwin/; revision=67690icc-effect-5.14.5
parent
6ff8139d9e
commit
b8e9f83e81
|
@ -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
|
||||
|
||||
|
|
|
@ -73,6 +73,7 @@ class Manager : public Client
|
|||
void paintEvent(QPaintEvent *);
|
||||
void resizeEvent(QResizeEvent *);
|
||||
void mouseDoubleClickEvent(QMouseEvent *);
|
||||
void animateIconifyOrDeiconify(bool);
|
||||
|
||||
protected slots:
|
||||
|
||||
|
|
Loading…
Reference in New Issue