mobileshell: Remove active window timer length to be immediate

We don't need a long delay, the shortest possible one works as well.
This commit is contained in:
Devin Lin 2022-04-11 11:55:56 -04:00
parent 6a31709897
commit e120f19601
2 changed files with 4 additions and 1 deletions

View file

@ -9,12 +9,13 @@
#include <QGuiApplication> #include <QGuiApplication>
constexpr int ACTIVE_WINDOW_UPDATE_INVERVAL = 250; constexpr int ACTIVE_WINDOW_UPDATE_INVERVAL = 0;
WindowUtil::WindowUtil(QObject *parent) WindowUtil::WindowUtil(QObject *parent)
: QObject{parent} : QObject{parent}
, m_activeWindowTimer{new QTimer{this}} , m_activeWindowTimer{new QTimer{this}}
{ {
// use 0 tick timer to update active window to ensure window state has finished changing
m_activeWindowTimer->setSingleShot(true); m_activeWindowTimer->setSingleShot(true);
m_activeWindowTimer->setInterval(ACTIVE_WINDOW_UPDATE_INVERVAL); m_activeWindowTimer->setInterval(ACTIVE_WINDOW_UPDATE_INVERVAL);
connect(m_activeWindowTimer, &QTimer::timeout, this, &WindowUtil::updateActiveWindow); connect(m_activeWindowTimer, &QTimer::timeout, this, &WindowUtil::updateActiveWindow);

View file

@ -22,6 +22,8 @@
/** /**
* Utility class that provides useful functions related to windows and KWin+KWayland. * Utility class that provides useful functions related to windows and KWin+KWayland.
* *
* TODO: Add per-screen support
*
* @author Devin Lin <devin@kde.org> * @author Devin Lin <devin@kde.org>
**/ **/
class WindowUtil : public QObject class WindowUtil : public QObject