From 4e28392c3ec9905e67c161f273295394352eebc2 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 17 Dec 2021 11:52:10 +0200 Subject: [PATCH] fix broken initialization of windows tracking --some improvements of 0.10.5 broke the windows tracking initialization. This is a fix in order for windows tracking to be enabled/disabled properly per dock/panel during startup phase. --- app/view/windowstracker/windowstracker.cpp | 11 +++-------- app/wm/tracker/trackedgeneralinfo.h | 8 ++++---- containment/package/contents/ui/BindingsExternal.qml | 5 ++++- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/app/view/windowstracker/windowstracker.cpp b/app/view/windowstracker/windowstracker.cpp index fbdaae070..232faf49e 100644 --- a/app/view/windowstracker/windowstracker.cpp +++ b/app/view/windowstracker/windowstracker.cpp @@ -35,14 +35,9 @@ WindowsTracker::WindowsTracker(Latte::View *parent) } }); - connect(m_latteView->positioner(), &Positioner::startupFinished, this, [&]() { - //! During startup phase windows tracking is not enabled and does not - //! influence startup sequence at all. At the same time to windows tracking - //! takes place during startup and as such startup time is reduced - m_wm->windowsTracker()->addView(m_latteView); - emit allScreensChanged(); - emit currentScreenChanged(); - }); + m_wm->windowsTracker()->addView(m_latteView); + emit allScreensChanged(); + emit currentScreenChanged(); } WindowsTracker::~WindowsTracker() diff --git a/app/wm/tracker/trackedgeneralinfo.h b/app/wm/tracker/trackedgeneralinfo.h index fcb467c2e..046db5074 100644 --- a/app/wm/tracker/trackedgeneralinfo.h +++ b/app/wm/tracker/trackedgeneralinfo.h @@ -79,10 +79,10 @@ protected: Tracker::Windows *m_tracker{nullptr}; private: - bool m_enabled; - bool m_activeWindowMaximized; - bool m_existsWindowActive; - bool m_existsWindowMaximized; + bool m_enabled{false}; + bool m_activeWindowMaximized{false}; + bool m_existsWindowActive{false}; + bool m_existsWindowMaximized{false}; bool m_isTrackingCurrentActivity{true}; diff --git a/containment/package/contents/ui/BindingsExternal.qml b/containment/package/contents/ui/BindingsExternal.qml index a55353a4f..bd39b113e 100644 --- a/containment/package/contents/ui/BindingsExternal.qml +++ b/containment/package/contents/ui/BindingsExternal.qml @@ -319,7 +319,10 @@ Item { Binding{ target: latteView && latteView.windowsTracker ? latteView.windowsTracker : null property: "enabled" - when: latteView && latteView.windowsTracker && latteView.visibility + //! During startup phase windows tracking is not enabled and does not + //! influence startup sequence at all. At the same time no windows tracking + //! takes place during startup and as such startup time is reduced + when: latteView && latteView.windowsTracker && latteView.visibility && !root.inStartup value: (latteView && latteView.visibility && !(latteView.visibility.mode === LatteCore.Types.AlwaysVisible /* Visibility */ || latteView.visibility.mode === LatteCore.Types.WindowsGoBelow