From e120f19601775d69fcb06ff18fae3334d2e51576 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Mon, 11 Apr 2022 11:55:56 -0400 Subject: [PATCH] mobileshell: Remove active window timer length to be immediate We don't need a long delay, the shortest possible one works as well. --- components/mobileshell/windowutil.cpp | 3 ++- components/mobileshell/windowutil.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/mobileshell/windowutil.cpp b/components/mobileshell/windowutil.cpp index 34540127..077e0544 100644 --- a/components/mobileshell/windowutil.cpp +++ b/components/mobileshell/windowutil.cpp @@ -9,12 +9,13 @@ #include -constexpr int ACTIVE_WINDOW_UPDATE_INVERVAL = 250; +constexpr int ACTIVE_WINDOW_UPDATE_INVERVAL = 0; WindowUtil::WindowUtil(QObject *parent) : QObject{parent} , 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->setInterval(ACTIVE_WINDOW_UPDATE_INVERVAL); connect(m_activeWindowTimer, &QTimer::timeout, this, &WindowUtil::updateActiveWindow); diff --git a/components/mobileshell/windowutil.h b/components/mobileshell/windowutil.h index 76bf19e7..84958168 100644 --- a/components/mobileshell/windowutil.h +++ b/components/mobileshell/windowutil.h @@ -22,6 +22,8 @@ /** * Utility class that provides useful functions related to windows and KWin+KWayland. * + * TODO: Add per-screen support + * * @author Devin Lin **/ class WindowUtil : public QObject