diff --git a/effects/presentwindows/presentwindows.h b/effects/presentwindows/presentwindows.h --- a/effects/presentwindows/presentwindows.h +++ b/effects/presentwindows/presentwindows.h @@ -27,8 +27,9 @@ #include #include +#include + class QMouseEvent; -class QElapsedTimer; class QQuickView; namespace KWin @@ -44,7 +45,7 @@ private Q_SLOTS: void clicked(); private: - QElapsedTimer *m_armTimer; + QElapsedTimer m_armTimer; }; /** diff --git a/effects/presentwindows/presentwindows.cpp b/effects/presentwindows/presentwindows.cpp --- a/effects/presentwindows/presentwindows.cpp +++ b/effects/presentwindows/presentwindows.cpp @@ -38,7 +38,6 @@ #include #include #include -#include #include #include @@ -1936,27 +1935,26 @@ CloseWindowView::CloseWindowView(QObject *parent) : EffectQuickScene(parent) - , m_armTimer(new QElapsedTimer()) { setSource(QUrl(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kwin/effects/presentwindows/main.qml")))); if (QQuickItem *item = rootItem()) { connect(item, SIGNAL(clicked()), this, SLOT(clicked())); setGeometry(QRect(QPoint(), QSize(item->implicitWidth(), item->implicitHeight()))); } - m_armTimer->restart(); + m_armTimer.restart(); } void CloseWindowView::clicked() { // 50ms until the window is elevated (seen!) and 300ms more to be "realized" by the user. - if (m_armTimer->hasExpired(350)) { + if (m_armTimer.hasExpired(350)) { emit requestClose(); } } void CloseWindowView::disarm() { - m_armTimer->restart(); + m_armTimer.restart(); }