1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-01 01:17:51 +03:00

improve trackedinfo(s)

This commit is contained in:
Michail Vourlakos 2019-06-08 13:43:50 +03:00
parent 96c081e076
commit 2b316aa728
6 changed files with 21 additions and 2 deletions

View File

@ -134,14 +134,22 @@ void TrackedGeneralInfo::setActiveWindow(const WindowId &wid)
m_lastActiveWindow->setInformation(m_tracker->infoFor(wid));
}
bool TrackedGeneralInfo::isTrackedOnActivity(const QString &activity) const
{
//! TODO:: needs to be updated for Layouts case
//! a way to access the first enabled View::activities in that specific
//! layout
return true;
}
bool TrackedGeneralInfo::isTracking(const WindowInfoWrap &winfo) const
{
return (winfo.isValid()
&& !winfo.isPlasmaDesktop()
&& !winfo.isMinimized()
&& winfo.isOnDesktop(m_wm->currentDesktop())
&& winfo.isOnActivity(m_wm->currentActivity()));
/*&& m_view->isOnActivity(m_wm->currentActivity()));*/
&& winfo.isOnActivity(m_wm->currentActivity())
&& isTrackedOnActivity(m_wm->currentActivity()));
}
}

View File

@ -76,6 +76,9 @@ public:
signals:
void lastActiveWindowChanged();
protected:
virtual bool isTrackedOnActivity(const QString &activity) const;
private:
bool m_enabled;
bool m_activeWindowMaximized;

View File

View File

@ -101,6 +101,11 @@ Latte::View *TrackedViewInfo::view() const
return m_view;
}
bool TrackedViewInfo::isTrackedOnActivity(const QString &activity) const
{
return m_view->isOnActivity(activity);
}
bool TrackedViewInfo::isTracking(const WindowInfoWrap &winfo) const
{
return TrackedGeneralInfo::isTracking(winfo)

View File

@ -66,6 +66,9 @@ public:
bool isTracking(const WindowInfoWrap &winfo) const override;
protected:
bool isTrackedOnActivity(const QString &activity) const override;
private:
bool m_activeWindowTouching;
bool m_existsWindowTouching;