diff --git a/app/wm/tracker/lastactivewindow.cpp b/app/wm/tracker/lastactivewindow.cpp index 35aed9f0..67ce603a 100644 --- a/app/wm/tracker/lastactivewindow.cpp +++ b/app/wm/tracker/lastactivewindow.cpp @@ -1,372 +1,417 @@ /* * Copyright 2019 Michail Vourlakos * * This file is part of Latte-Dock * * Latte-Dock is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Latte-Dock is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "lastactivewindow.h" // local #include "trackedgeneralinfo.h" #include "trackerwindows.h" #include "../abstractwindowinterface.h" #include "../tasktools.h" #include "../../view/view.h" // Qt #include #include #include namespace Latte { namespace WindowSystem { namespace Tracker { +const int INVALIDWID = -1; + LastActiveWindow::LastActiveWindow(TrackedGeneralInfo *trackedInfo) : QObject(trackedInfo), m_trackedInfo(trackedInfo), m_windowsTracker(trackedInfo->wm()->windowsTracker()), m_wm(trackedInfo->wm()) { - connect(m_windowsTracker, &Windows::activeWindowChanged, this, &LastActiveWindow::windowChanged); connect(m_windowsTracker, &Windows::windowChanged, this, &LastActiveWindow::windowChanged); connect(m_windowsTracker, &Windows::windowRemoved, this, &LastActiveWindow::windowRemoved); } LastActiveWindow::~LastActiveWindow() { } bool LastActiveWindow::isActive() const { return m_isActive; } void LastActiveWindow::setActive(bool active) { if (m_isActive == active) { return; } m_isActive = active; emit isActiveChanged(); } bool LastActiveWindow::isMinimized() const { return m_isMinimized; } void LastActiveWindow::setIsMinimized(bool minimized) { if (m_isMinimized == minimized) { return; } m_isMinimized = minimized; emit isMinimizedChanged(); } bool LastActiveWindow::isMaximized() const { return m_isMaximized; } void LastActiveWindow::setIsMaximized(bool maximized) { if (m_isMaximized == maximized) { return; } m_isMaximized = maximized; emit isMaximizedChanged(); } bool LastActiveWindow::isFullScreen() const { return m_isFullScreen; } void LastActiveWindow::setIsFullScreen(bool fullscreen) { if (m_isFullScreen == fullscreen) { return; } m_isFullScreen = fullscreen; emit isFullScreenChanged(); } bool LastActiveWindow::isKeepAbove() const { return m_isKeepAbove; } void LastActiveWindow::setIsKeepAbove(bool above) { if (m_isKeepAbove == above) { return; } m_isKeepAbove = above; emit isKeepAboveChanged(); } bool LastActiveWindow::isOnAllDesktops() const { return m_isOnAllDesktops; } void LastActiveWindow::setIsOnAllDesktops(bool all) { if (m_isOnAllDesktops == all) { return; } m_isOnAllDesktops = all; emit isOnAllDesktopsChanged(); } bool LastActiveWindow::isShaded() const { return m_isShaded; } void LastActiveWindow::setIsShaded(bool shaded) { if (m_isShaded == shaded) { return; } m_isShaded = shaded; emit isShadedChanged(); } +bool LastActiveWindow::isValid() const +{ + return m_isValid; +} + +void LastActiveWindow::setIsValid(bool valid) +{ + if (m_isValid == valid) { + return; + } + + m_isValid = valid; + emit isValidChanged(); +} + bool LastActiveWindow::hasSkipTaskbar() const { return m_hasSkipTaskbar; } void LastActiveWindow::setHasSkipTaskbar(bool skip) { if (m_hasSkipTaskbar == skip) { return; } m_hasSkipTaskbar = skip; emit hasSkipTaskbarChanged(); } QRect LastActiveWindow::geometry() const { return m_geometry; } void LastActiveWindow::setGeometry(QRect geometry) { if (m_geometry == geometry) { return; } m_geometry = geometry; emit geometryChanged(); } QString LastActiveWindow::appName() const { return m_appName; } void LastActiveWindow::setAppName(QString appName) { if (m_appName == appName) { return; } m_appName = appName; emit appNameChanged(); } QString LastActiveWindow::display() const { return m_display; } void LastActiveWindow::setDisplay(QString display) { if (m_display == display) { return; } m_display = display; emit displayChanged(); } QIcon LastActiveWindow::icon() const { return m_icon; } void LastActiveWindow::setIcon(QIcon icon) { m_icon = icon; emit iconChanged(); } QVariant LastActiveWindow::winId() const { return m_winId; } void LastActiveWindow::setWinId(QVariant winId) { - if (m_winId == winId) { + if (m_winId == winId && isValid()) { return; } if (!m_history.contains(winId)) { m_history.prepend(winId); } else { int p = m_history.indexOf(winId); //! move to start m_history.move(p, 0); } m_winId = winId; emit winIdChanged(); } void LastActiveWindow::setInformation(const WindowInfoWrap &info) { setWinId(info.wid()); + setIsValid(true); setActive(info.isActive()); setIsMinimized(info.isMinimized()); setIsMaximized(info.isMaxVert() || info.isMaxHoriz()); setIsOnAllDesktops(info.isOnAllDesktops()); setAppName(info.appName()); setDisplay(info.display()); setGeometry(info.geometry()); setIsKeepAbove(info.isKeepAbove()); if (info.appName().isEmpty()) { setAppName(m_windowsTracker->appNameFor(info.wid())); } else { setAppName(info.appName()); } if (info.icon().isNull()) { setIcon(m_windowsTracker->iconFor(info.wid())); } else { setIcon(info.icon()); } - } //! PRIVATE SLOTS void LastActiveWindow::windowChanged(const WindowId &wid) { if (!m_trackedInfo->enabled()) { + qDebug() << " Window Changed : TrackedInfo is disabled..."; return; } - if (m_winId == wid && !wid.isNull()) { - setInformation(m_windowsTracker->infoFor(wid)); - } else if (m_history.contains(wid)) { + if (m_history.contains(wid)) { //! remove from history minimized windows or windows that changed screen - //! and update information accordingly with the first window found from + //! and update information accordingly with the first valid window found from //! history after the removal WindowInfoWrap winfo = m_windowsTracker->infoFor(wid); + bool firstItemRemoved{false}; + + //! Remove minimized windows OR NOT-TRACKED windows from history if (winfo.isMinimized() || !m_trackedInfo->isTracking(winfo)) { + if (m_history[0] == wid) { + firstItemRemoved = true; + } m_history.removeAll(wid); + } - if (m_history.count() > 0) { - setInformation(m_windowsTracker->infoFor(m_history[0])); + if (m_history.count() > 0) { + if (m_history[0] == wid || firstItemRemoved) { + WindowInfoWrap history1 = m_windowsTracker->infoFor(m_history[0]); + + //! Check if first found History window is still valid to show its information + if (history1.isMinimized() || !m_trackedInfo->isTracking(history1)) { + windowChanged(m_history[0]); + } else { + setInformation(history1); + } } + } else { + //! History is empty so any demonstrated information are invalid + setIsValid(false); } + + qDebug() << " HISTORY ::: " << m_history; + } else { + qDebug() << " LastActiveWindow : window is not in history"; } } void LastActiveWindow::windowRemoved(const WindowId &wid) { if (m_history.contains(wid)) { + bool firstItemRemoved{false}; + + if (m_history.count() > 0 && m_history[0] == wid) { + firstItemRemoved = true; + } + m_history.removeAll(wid); - if (m_history.count() > 0) { - setInformation(m_windowsTracker->infoFor(m_history[0])); + if (m_history.count() > 0 && firstItemRemoved) { + windowChanged(m_history[0]); + } else { + setIsValid(false); } } } //! FUNCTIONALITY void LastActiveWindow::requestActivate() { m_wm->requestActivate(m_winId); } void LastActiveWindow::requestClose() { m_wm->requestClose(m_winId); } void LastActiveWindow::requestMove(Latte::View *fromView, int localX, int localY) { QPoint globalPoint{fromView->x() + localX, fromView->y() + localY}; m_wm->requestMoveWindow(m_winId, globalPoint); auto viewId = m_winId; //! This timer is needed because otherwise the mouse position //! in the dragged window changes to TopLeft corner QTimer::singleShot(250, this, [&, viewId]() { m_wm->releaseMouseEventFor(viewId); }); emit draggingStarted(); } void LastActiveWindow::requestToggleIsOnAllDesktops() { m_wm->requestToggleIsOnAllDesktops(m_winId); } void LastActiveWindow::requestToggleKeepAbove() { m_wm->requestToggleKeepAbove(m_winId); } void LastActiveWindow::requestToggleMinimized() { m_wm->requestToggleMinimized(m_winId); } void LastActiveWindow::requestToggleMaximized() { m_wm->requestToggleMaximized(m_winId); } bool LastActiveWindow::canBeDragged() { return m_wm->windowCanBeDragged(m_winId); } } } } diff --git a/app/wm/tracker/lastactivewindow.h b/app/wm/tracker/lastactivewindow.h index 871c831f..c96aa157 100644 --- a/app/wm/tracker/lastactivewindow.h +++ b/app/wm/tracker/lastactivewindow.h @@ -1,171 +1,176 @@ /* * Copyright 2019 Michail Vourlakos * * This file is part of Latte-Dock * * Latte-Dock is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Latte-Dock is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef WINDOWSYSTEMLASTACTIVEWINDOW_H #define WINDOWSYSTEMLASTACTIVEWINDOW_H // local #include "../windowinfowrap.h" #include "../abstractwindowinterface.h" // Qt #include #include namespace Latte { class View; namespace WindowSystem { class AbstractWindowInterface; namespace Tracker { class TrackedGeneralInfo; class Windows; } } } namespace Latte { namespace WindowSystem { namespace Tracker { class LastActiveWindow : public QObject { Q_OBJECT Q_PROPERTY(bool isActive READ isActive NOTIFY isActiveChanged) Q_PROPERTY(bool isMinimized READ isMinimized NOTIFY isMinimizedChanged) Q_PROPERTY(bool isMaximized READ isMaximized NOTIFY isMaximizedChanged) Q_PROPERTY(bool isFullScreen READ isFullScreen NOTIFY isFullScreenChanged) Q_PROPERTY(bool isKeepAbove READ isKeepAbove NOTIFY isKeepAboveChanged) Q_PROPERTY(bool isOnAllDesktops READ isOnAllDesktops NOTIFY isOnAllDesktopsChanged) Q_PROPERTY(bool isShaded READ isShaded NOTIFY isShadedChanged) + Q_PROPERTY(bool isValid READ isValid NOTIFY isValidChanged) Q_PROPERTY(bool hasSkipTaskbar READ hasSkipTaskbar NOTIFY hasSkipTaskbarChanged) Q_PROPERTY(QString appName READ appName NOTIFY appNameChanged) Q_PROPERTY(QString display READ display NOTIFY displayChanged) Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged) Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged) Q_PROPERTY(QVariant winId READ winId NOTIFY winIdChanged) public: LastActiveWindow(TrackedGeneralInfo *trackedInfo); ~LastActiveWindow() override; bool isActive() const; bool isMinimized() const; bool isMaximized() const; bool isFullScreen() const; bool isKeepAbove() const; bool isOnAllDesktops() const; bool isShaded() const; + bool isValid() const; bool hasSkipTaskbar() const; QString appName() const; QString display() const; QRect geometry() const; QIcon icon() const; QVariant winId() const; void setInformation(const WindowInfoWrap &info); public slots: Q_INVOKABLE void requestActivate(); Q_INVOKABLE void requestClose(); Q_INVOKABLE void requestToggleIsOnAllDesktops(); Q_INVOKABLE void requestToggleKeepAbove(); Q_INVOKABLE void requestToggleMinimized(); Q_INVOKABLE void requestToggleMaximized(); Q_INVOKABLE bool canBeDragged(); void requestMove(Latte::View *fromView, int localX, int localY); private slots: void windowChanged(const WindowId &wid); void windowRemoved(const WindowId &wid); signals: void draggingStarted(); void iconChanged(); void isActiveChanged(); void isMinimizedChanged(); void isMaximizedChanged(); void isFullScreenChanged(); void isKeepAboveChanged(); void isOnAllDesktopsChanged(); void isShadedChanged(); + void isValidChanged(); void hasSkipTaskbarChanged(); void appNameChanged(); void displayChanged(); void geometryChanged(); void winIdChanged(); private: void setActive(bool active); void setIsMinimized(bool minimized); void setIsMaximized(bool maximized); void setIsFullScreen(bool fullscreen); void setIsKeepAbove(bool above); void setIsOnAllDesktops(bool all); void setIsShaded(bool shaded); + void setIsValid(bool valid); void setHasSkipTaskbar(bool skip); void setAppName(QString appName); void setDisplay(QString display); void setGeometry(QRect geometry); void setIcon(QIcon icon); void setWinId(QVariant winId); private: bool m_isActive{false}; bool m_isMinimized{false}; bool m_isMaximized{false}; bool m_isFullScreen{false}; bool m_isKeepAbove{false}; bool m_isOnAllDesktops{false}; bool m_isShaded{false}; + bool m_isValid{false}; bool m_hasSkipTaskbar{false}; QString m_appName; QString m_display; QRect m_geometry; QIcon m_icon; QVariant m_winId; QList m_history; TrackedGeneralInfo *m_trackedInfo{nullptr}; AbstractWindowInterface *m_wm{nullptr}; Tracker::Windows *m_windowsTracker{nullptr}; }; } } } #endif diff --git a/app/wm/tracker/trackedviewinfo.cpp b/app/wm/tracker/trackedviewinfo.cpp index 3fdb885c..547e330e 100644 --- a/app/wm/tracker/trackedviewinfo.cpp +++ b/app/wm/tracker/trackedviewinfo.cpp @@ -1,118 +1,118 @@ /* * Copyright 2019 Michail Vourlakos * * This file is part of Latte-Dock * * Latte-Dock is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Latte-Dock is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "trackedviewinfo.h" //local #include "trackerwindows.h" #include "../schemecolors.h" #include "../../view/view.h" namespace Latte { namespace WindowSystem { namespace Tracker { TrackedViewInfo::TrackedViewInfo(Tracker::Windows *tracker, Latte::View *view) : TrackedGeneralInfo(tracker) , m_view(view) { m_activities = m_view->activities(); connect(m_view, &Latte::View::activitiesChanged, this, [&]() { m_activities = m_view->activities(); updateTrackingCurrentActivity(); }); } TrackedViewInfo::~TrackedViewInfo() { } bool TrackedViewInfo::activeWindowTouching() const { return m_activeWindowTouching; } void TrackedViewInfo::setActiveWindowTouching(bool touching) { if (m_activeWindowTouching == touching) { return; } m_activeWindowTouching = touching; } bool TrackedViewInfo::existsWindowTouching() const { return m_existsWindowTouching; } void TrackedViewInfo::setExistsWindowTouching(bool touching) { if (m_existsWindowTouching == touching) { return; } m_existsWindowTouching = touching; } QRect TrackedViewInfo::availableScreenGeometry() const { return m_availableScreenGeometry; } void TrackedViewInfo::setAvailableScreenGeometry(QRect geometry) { if (m_availableScreenGeometry == geometry) { return; } m_availableScreenGeometry = geometry; } SchemeColors *TrackedViewInfo::touchingWindowScheme() const { return m_touchingWindowScheme; } void TrackedViewInfo::setTouchingWindowScheme(SchemeColors *scheme) { if (m_touchingWindowScheme == scheme) { return; } m_touchingWindowScheme = scheme; } Latte::View *TrackedViewInfo::view() const { return m_view; } bool TrackedViewInfo::isTracking(const WindowInfoWrap &winfo) const -{ +{ return TrackedGeneralInfo::isTracking(winfo) && m_availableScreenGeometry.contains(winfo.geometry().center()); } } } } diff --git a/app/wm/tracker/trackerwindows.cpp b/app/wm/tracker/trackerwindows.cpp index 31ab0d05..f3975935 100644 --- a/app/wm/tracker/trackerwindows.cpp +++ b/app/wm/tracker/trackerwindows.cpp @@ -1,893 +1,893 @@ /* * Copyright 2019 Michail Vourlakos * * This file is part of Latte-Dock * * Latte-Dock is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Latte-Dock is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "trackerwindows.h" // local #include "lastactivewindow.h" #include "schemes.h" #include "trackedlayoutinfo.h" #include "trackedviewinfo.h" #include "../abstractwindowinterface.h" #include "../schemecolors.h" #include "../../lattecorona.h" #include "../../layout/genericlayout.h" #include "../../layouts/manager.h" #include "../../view/view.h" #include "../../view/positioner.h" #include "../../../liblatte2/types.h" namespace Latte { namespace WindowSystem { namespace Tracker { Windows::Windows(AbstractWindowInterface *parent) : QObject(parent) { m_wm = parent; init(); } Windows::~Windows() { //! clear all the m_views tracking information for (QHash::iterator i=m_views.begin(); i!=m_views.end(); ++i) { i.value()->deleteLater(); m_views[i.key()] = nullptr; } m_views.clear(); //! clear all the m_layouts tracking layouts for (QHash::iterator i=m_layouts.begin(); i!=m_layouts.end(); ++i) { i.value()->deleteLater(); m_layouts[i.key()] = nullptr; } m_layouts.clear(); } void Windows::init() { connect(m_wm->corona(), &Plasma::Corona::availableScreenRectChanged, this, &Windows::updateAvailableScreenGeometries); connect(m_wm, &AbstractWindowInterface::windowChanged, this, [&](WindowId wid) { m_windows[wid] = m_wm->requestInfo(wid); updateAllHints(); emit windowChanged(wid); }); connect(m_wm, &AbstractWindowInterface::windowRemoved, this, [&](WindowId wid) { m_windows.remove(wid); updateAllHints(); emit windowRemoved(wid); }); connect(m_wm, &AbstractWindowInterface::windowAdded, this, [&](WindowId wid) { if (!m_windows.contains(wid)) { m_windows.insert(wid, m_wm->requestInfo(wid)); } updateAllHints(); }); connect(m_wm, &AbstractWindowInterface::activeWindowChanged, this, [&](WindowId wid) { //! for some reason this is needed in order to update properly activeness values //! when the active window changes the previous active windows should be also updated for (const auto view : m_views.keys()) { WindowId lastWinId = m_views[view]->lastActiveWindow()->winId(); if ((lastWinId) != wid && m_windows.contains(lastWinId)) { m_windows[lastWinId] = m_wm->requestInfo(lastWinId); } } m_windows[wid] = m_wm->requestInfo(wid); updateAllHints(); emit activeWindowChanged(wid); }); connect(m_wm, &AbstractWindowInterface::currentDesktopChanged, this, [&] { updateAllHints(); }); connect(m_wm, &AbstractWindowInterface::currentActivityChanged, this, [&] { if (m_wm->corona()->layoutsManager()->memoryUsage() == Types::MultipleLayouts) { //! this is needed in MultipleLayouts because there is a chance that multiple //! layouts are providing different available screen geometries in different Activities updateAvailableScreenGeometries(); } updateAllHints(); }); } void Windows::initLayoutHints(Latte::Layout::GenericLayout *layout) { if (!m_layouts.contains(layout)) { return; } setActiveWindowMaximized(layout, false); setExistsWindowActive(layout, false); setExistsWindowMaximized(layout, false); setActiveWindowScheme(layout, nullptr); } void Windows::initViewHints(Latte::View *view) { if (!m_views.contains(view)) { return; } setActiveWindowMaximized(view, false); setActiveWindowTouching(view, false); setExistsWindowActive(view, false); setExistsWindowTouching(view, false); setExistsWindowMaximized(view, false); setActiveWindowScheme(view, nullptr); setTouchingWindowScheme(view, nullptr); } AbstractWindowInterface *Windows::wm() { return m_wm; } void Windows::addView(Latte::View *view) { if (m_views.contains(view)) { return; } m_views[view] = new TrackedViewInfo(this, view); updateAvailableScreenGeometries(); //! Consider Layouts addRelevantLayout(view); connect(view, &Latte::View::layoutChanged, this, [&, view]() { addRelevantLayout(view); }); - updateHints(view); + updateAllHints(); emit informationAnnounced(view); } void Windows::removeView(Latte::View *view) { if (!m_views.contains(view)) { return; } m_views[view]->deleteLater(); m_views.remove(view); updateRelevantLayouts(); } void Windows::addRelevantLayout(Latte::View *view) { if (view->layout() && !m_layouts.contains(view->layout())) { m_layouts[view->layout()] = new TrackedLayoutInfo(this, view->layout()); updateRelevantLayouts(); updateHints(view->layout()); emit informationAnnouncedForLayout(view->layout()); } } void Windows::updateRelevantLayouts() { QList orphanedLayouts; //! REMOVE Orphaned Relevant layouts that have been removed or they dont contain any Views anymore for (QHash::iterator i=m_layouts.begin(); i!=m_layouts.end(); ++i) { bool hasView{false}; for (QHash::iterator j=m_views.begin(); j!=m_views.end(); ++j) { if (j.key() && i.key() && i.key() == j.key()->layout()) { hasView = true; break; } } if (!hasView) { if (i.value()) { i.value()->deleteLater(); } orphanedLayouts << i.key(); } } for(const auto &layout : orphanedLayouts) { m_layouts.remove(layout); } //! UPDATE Enabled layout window tracking based on the Views that are requesting windows tracking for (QHash::iterator i=m_layouts.begin(); i!=m_layouts.end(); ++i) { bool hasViewEnabled{false}; for (QHash::iterator j=m_views.begin(); j!=m_views.end(); ++j) { if (i.key() == j.key()->layout() && j.value()->enabled()) { hasViewEnabled = true; break; } } if (i.value()) { i.value()->setEnabled(hasViewEnabled); if (!hasViewEnabled) { initLayoutHints(i.key()); } } } } //! Views Properties And Hints bool Windows::enabled(Latte::View *view) { if (!m_views.contains(view)) { return false; } return m_views[view]->enabled(); } void Windows::setEnabled(Latte::View *view, const bool enabled) { if (!m_views.contains(view) || m_views[view]->enabled() == enabled) { return; } m_views[view]->setEnabled(enabled); if (enabled) { updateHints(view); } else { initViewHints(view); } updateRelevantLayouts(); emit enabledChanged(view); } bool Windows::activeWindowMaximized(Latte::View *view) const { if (!m_views.contains(view)) { return false; } return m_views[view]->activeWindowMaximized(); } void Windows::setActiveWindowMaximized(Latte::View *view, bool activeMaximized) { if (!m_views.contains(view) || m_views[view]->activeWindowMaximized() == activeMaximized) { return; } m_views[view]->setActiveWindowMaximized(activeMaximized); emit activeWindowMaximizedChanged(view); } bool Windows::activeWindowTouching(Latte::View *view) const { if (!m_views.contains(view)) { return false; } return m_views[view]->activeWindowTouching(); } void Windows::setActiveWindowTouching(Latte::View *view, bool activeTouching) { if (!m_views.contains(view) || m_views[view]->activeWindowTouching() == activeTouching) { return; } m_views[view]->setActiveWindowTouching(activeTouching); emit activeWindowTouchingChanged(view); } bool Windows::existsWindowActive(Latte::View *view) const { if (!m_views.contains(view)) { return false; } return m_views[view]->existsWindowActive(); } void Windows::setExistsWindowActive(Latte::View *view, bool windowActive) { if (!m_views.contains(view) || m_views[view]->existsWindowActive() == windowActive) { return; } m_views[view]->setExistsWindowActive(windowActive); emit existsWindowActiveChanged(view); } bool Windows::existsWindowMaximized(Latte::View *view) const { if (!m_views.contains(view)) { return false; } return m_views[view]->existsWindowMaximized(); } void Windows::setExistsWindowMaximized(Latte::View *view, bool windowMaximized) { if (!m_views.contains(view) || m_views[view]->existsWindowMaximized() == windowMaximized) { return; } m_views[view]->setExistsWindowMaximized(windowMaximized); emit existsWindowMaximizedChanged(view); } bool Windows::existsWindowTouching(Latte::View *view) const { if (!m_views.contains(view)) { return false; } return m_views[view]->existsWindowTouching(); } void Windows::setExistsWindowTouching(Latte::View *view, bool windowTouching) { if (!m_views.contains(view) || m_views[view]->existsWindowTouching() == windowTouching) { return; } m_views[view]->setExistsWindowTouching(windowTouching); emit existsWindowTouchingChanged(view); } SchemeColors *Windows::activeWindowScheme(Latte::View *view) const { if (!m_views.contains(view)) { return nullptr; } return m_views[view]->activeWindowScheme(); } void Windows::setActiveWindowScheme(Latte::View *view, WindowSystem::SchemeColors *scheme) { if (!m_views.contains(view) || m_views[view]->activeWindowScheme() == scheme) { return; } m_views[view]->setActiveWindowScheme(scheme); emit activeWindowSchemeChanged(view); } SchemeColors *Windows::touchingWindowScheme(Latte::View *view) const { if (!m_views.contains(view)) { return nullptr; } return m_views[view]->touchingWindowScheme(); } void Windows::setTouchingWindowScheme(Latte::View *view, WindowSystem::SchemeColors *scheme) { if (!m_views.contains(view) || m_views[view]->touchingWindowScheme() == scheme) { return; } m_views[view]->setTouchingWindowScheme(scheme); emit touchingWindowSchemeChanged(view); } LastActiveWindow *Windows::lastActiveWindow(Latte::View *view) { if (!m_views.contains(view)) { return nullptr; } return m_views[view]->lastActiveWindow(); } //! Layouts bool Windows::enabled(Latte::Layout::GenericLayout *layout) { if (!m_layouts.contains(layout)) { return false; } return m_layouts[layout]->enabled(); } bool Windows::activeWindowMaximized(Latte::Layout::GenericLayout *layout) const { if (!m_layouts.contains(layout)) { return false; } return m_layouts[layout]->activeWindowMaximized(); } void Windows::setActiveWindowMaximized(Latte::Layout::GenericLayout *layout, bool activeMaximized) { if (!m_layouts.contains(layout) || m_layouts[layout]->activeWindowMaximized() == activeMaximized) { return; } m_layouts[layout]->setActiveWindowMaximized(activeMaximized); emit activeWindowMaximizedChangedForLayout(layout); } bool Windows::existsWindowActive(Latte::Layout::GenericLayout *layout) const { if (!m_layouts.contains(layout)) { return false; } return m_layouts[layout]->existsWindowActive(); } void Windows::setExistsWindowActive(Latte::Layout::GenericLayout *layout, bool windowActive) { if (!m_layouts.contains(layout) || m_layouts[layout]->existsWindowActive() == windowActive) { return; } m_layouts[layout]->setExistsWindowActive(windowActive); emit existsWindowActiveChangedForLayout(layout); } bool Windows::existsWindowMaximized(Latte::Layout::GenericLayout *layout) const { if (!m_layouts.contains(layout)) { return false; } return m_layouts[layout]->existsWindowMaximized(); } void Windows::setExistsWindowMaximized(Latte::Layout::GenericLayout *layout, bool windowMaximized) { if (!m_layouts.contains(layout) || m_layouts[layout]->existsWindowMaximized() == windowMaximized) { return; } m_layouts[layout]->setExistsWindowMaximized(windowMaximized); emit existsWindowMaximizedChangedForLayout(layout); } SchemeColors *Windows::activeWindowScheme(Latte::Layout::GenericLayout *layout) const { if (!m_layouts.contains(layout)) { return nullptr; } return m_layouts[layout]->activeWindowScheme(); } void Windows::setActiveWindowScheme(Latte::Layout::GenericLayout *layout, WindowSystem::SchemeColors *scheme) { if (!m_layouts.contains(layout) || m_layouts[layout]->activeWindowScheme() == scheme) { return; } m_layouts[layout]->setActiveWindowScheme(scheme); emit activeWindowSchemeChangedForLayout(layout); } LastActiveWindow *Windows::lastActiveWindow(Latte::Layout::GenericLayout *layout) { if (!m_layouts.contains(layout)) { return nullptr; } return m_layouts[layout]->lastActiveWindow(); } //! Windows bool Windows::isValidFor(const WindowId &wid) const { if (!m_windows.contains(wid)) { return false; } return m_windows[wid].isValid() && !m_windows[wid].isPlasmaDesktop(); } QIcon Windows::iconFor(const WindowId &wid) { if (!m_windows.contains(wid)) { return QIcon(); } if (m_windows[wid].icon().isNull()) { AppData data = m_wm->appDataFor(wid); QIcon icon = data.icon; if (icon.isNull()) { icon = m_wm->iconFor(wid); } m_windows[wid].setIcon(icon); return icon; } return m_windows[wid].icon(); } QString Windows::appNameFor(const WindowId &wid) { if (!m_windows.contains(wid)) { return QString(); } if (m_windows[wid].appName().isEmpty()) { AppData data = m_wm->appDataFor(wid); m_windows[wid].setAppName(data.name); return data.name; } return m_windows[wid].appName(); } WindowInfoWrap Windows::infoFor(const WindowId &wid) const { if (!m_windows.contains(wid)) { return WindowInfoWrap(); } return m_windows[wid]; } //! Windows Criteria Functions bool Windows::inCurrentDesktopActivity(const WindowInfoWrap &winfo) { return (winfo.isValid() && winfo.isOnDesktop(m_wm->currentDesktop()) && winfo.isOnActivity(m_wm->currentActivity())); } bool Windows::intersects(Latte::View *view, const WindowInfoWrap &winfo) { return (!winfo.isMinimized() && !winfo.isShaded() && winfo.geometry().intersects(view->absoluteGeometry())); } bool Windows::isActive(const WindowInfoWrap &winfo) { return (winfo.isValid() && winfo.isActive() && !winfo.isPlasmaDesktop() && !winfo.isMinimized()); } bool Windows::isActiveInViewScreen(Latte::View *view, const WindowInfoWrap &winfo) { return (winfo.isValid() && winfo.isActive() && !winfo.isPlasmaDesktop() && !winfo.isMinimized() && m_views[view]->availableScreenGeometry().contains(winfo.geometry().center())); } bool Windows::isMaximizedInViewScreen(Latte::View *view, const WindowInfoWrap &winfo) { auto viewIntersectsMaxVert = [&]() noexcept -> bool { return ((winfo.isMaxVert() || (view->screen() && view->screen()->availableSize().height() <= winfo.geometry().height())) && intersects(view, winfo)); }; auto viewIntersectsMaxHoriz = [&]() noexcept -> bool { return ((winfo.isMaxHoriz() || (view->screen() && view->screen()->availableSize().width() <= winfo.geometry().width())) && intersects(view, winfo)); }; //! updated implementation to identify the screen that the maximized window is present //! in order to avoid: https://bugs.kde.org/show_bug.cgi?id=397700 return (winfo.isValid() && !winfo.isPlasmaDesktop() && !winfo.isMinimized() && (winfo.isMaximized() || viewIntersectsMaxVert() || viewIntersectsMaxHoriz()) && m_views[view]->availableScreenGeometry().contains(winfo.geometry().center())); } bool Windows::isTouchingView(Latte::View *view, const WindowSystem::WindowInfoWrap &winfo) { return (winfo.isValid() && !winfo.isPlasmaDesktop() && intersects(view, winfo)); } bool Windows::isTouchingViewEdge(Latte::View *view, const WindowInfoWrap &winfo) { if (winfo.isValid() && !winfo.isPlasmaDesktop() && !winfo.isMinimized()) { bool touchingViewEdge{false}; QRect screenGeometry = view->screenGeometry(); QRect availableScreenGeometry = m_views[view]->availableScreenGeometry(); bool inCurrentScreen{screenGeometry.contains(winfo.geometry().topLeft()) || screenGeometry.contains(winfo.geometry().bottomRight())}; if (inCurrentScreen) { if (view->location() == Plasma::Types::TopEdge) { touchingViewEdge = (winfo.geometry().y() == availableScreenGeometry.y()); } else if (view->location() == Plasma::Types::BottomEdge) { touchingViewEdge = (winfo.geometry().bottom() == availableScreenGeometry.bottom()); } else if (view->location() == Plasma::Types::LeftEdge) { touchingViewEdge = (winfo.geometry().x() == availableScreenGeometry.x()); } else if (view->location() == Plasma::Types::RightEdge) { touchingViewEdge = (winfo.geometry().right() == availableScreenGeometry.right()); } } return touchingViewEdge; } return false; } void Windows::cleanupFaultyWindows() { for (const auto &key : m_windows.keys()) { auto winfo = m_windows[key]; //! garbage windows removing if (winfo.geometry() == QRect(0, 0, 0, 0)) { //qDebug() << "Faulty Geometry ::: " << winfo.wid(); m_windows.remove(key); } } } void Windows::updateAvailableScreenGeometries() { for (const auto view : m_views.keys()) { if (m_views[view]->enabled()) { int currentScrId = view->positioner()->currentScreenId(); QRect tempAvailableScreenGeometry = m_wm->corona()->availableScreenRectWithCriteria(currentScrId, {Types::AlwaysVisible}, {}); if (tempAvailableScreenGeometry != m_views[view]->availableScreenGeometry()) { m_views[view]->setAvailableScreenGeometry(tempAvailableScreenGeometry); updateHints(view); } } } } void Windows::setPlasmaDesktop(WindowId wid) { if (!m_windows.contains(wid)) { return; } if (!m_windows[wid].isPlasmaDesktop()) { m_windows[wid].setIsPlasmaDesktop(true); qDebug() << " plasmashell updated..."; updateAllHints(); } } void Windows::updateAllHints() { for (const auto view : m_views.keys()) { updateHints(view); } for (const auto layout : m_layouts.keys()) { updateHints(layout); } } void Windows::updateHints(Latte::View *view) { if (!m_views.contains(view) || !m_views[view]->enabled() || !m_views[view]->isTrackingCurrentActivity()) { return; } bool foundActive{false}; bool foundActiveInCurScreen{false}; bool foundActiveTouchInCurScreen{false}; bool foundTouchInCurScreen{false}; bool foundMaximizedInCurScreen{false}; //! the notification window is not sending a remove signal and creates windows of geometry (0x0 0,0), //! maybe a garbage collector here is a good idea!!! bool existsFaultyWindow{false}; WindowId maxWinId; WindowId activeWinId; WindowId touchWinId; WindowId activeTouchWinId; for (const auto &winfo : m_windows) { if (winfo.isPlasmaDesktop() || !inCurrentDesktopActivity(winfo)) { continue; } if (isActive(winfo)) { foundActive = true; } if (isActiveInViewScreen(view, winfo)) { foundActiveInCurScreen = true; activeWinId = winfo.wid(); } if (isTouchingViewEdge(view, winfo) || isTouchingView(view, winfo)) { if (winfo.isActive()) { foundActiveTouchInCurScreen = true; activeTouchWinId = winfo.wid(); if (isMaximizedInViewScreen(view, winfo)) { //! active maximized windows have higher priority than the rest maximized windows foundMaximizedInCurScreen = true; maxWinId = winfo.wid(); } } else { foundTouchInCurScreen = true; touchWinId = winfo.wid(); } if (!foundMaximizedInCurScreen && isMaximizedInViewScreen(view, winfo)) { foundMaximizedInCurScreen = true; maxWinId = winfo.wid(); } } if (!existsFaultyWindow && winfo.geometry() == QRect(0, 0, 0, 0)) { existsFaultyWindow = true; } //qDebug() << "window geometry ::: " << winfo.geometry(); } if (existsFaultyWindow) { cleanupFaultyWindows(); } //! HACK: KWin Effects such as ShowDesktop have no way to be identified and as such //! create issues with identifying properly touching and maximized windows. BUT when //! they are enabled then NO ACTIVE window is found. This is a way to identify these //! effects trigerring and disable the touch flags. //! BUG: 404483 //! Disabled because it has fault identifications, e.g. when a window is maximized and //! Latte or Plasma are showing their View settings //foundMaximizedInCurScreen = foundMaximizedInCurScreen && foundActive; //foundTouchInCurScreen = foundTouchInCurScreen && foundActive; //! assign flags setExistsWindowActive(view, foundActiveInCurScreen); setActiveWindowTouching(view, foundActiveTouchInCurScreen); setActiveWindowMaximized(view, (maxWinId.toInt()>0 && (maxWinId == activeTouchWinId))); setExistsWindowMaximized(view, foundMaximizedInCurScreen); setExistsWindowTouching(view, (foundTouchInCurScreen || foundActiveTouchInCurScreen)); //! update color schemes for active and touching windows setActiveWindowScheme(view, (foundActiveInCurScreen ? m_wm->schemesTracker()->schemeForWindow(activeWinId) : nullptr)); if (foundActiveTouchInCurScreen) { setTouchingWindowScheme(view, m_wm->schemesTracker()->schemeForWindow(activeTouchWinId)); } else if (foundMaximizedInCurScreen) { setTouchingWindowScheme(view, m_wm->schemesTracker()->schemeForWindow(maxWinId)); } else if (foundTouchInCurScreen) { setTouchingWindowScheme(view, m_wm->schemesTracker()->schemeForWindow(touchWinId)); } else { setTouchingWindowScheme(view, nullptr); } //! update LastActiveWindow if (foundActiveInCurScreen) { m_views[view]->setActiveWindow(activeWinId); } //! Debug //qDebug() << "TRACKING | SCREEN: " << view->positioner()->currentScreenId() << " , EDGE:" << view->location() << " , ENABLED:" << enabled(view); //qDebug() << "TRACKING | activeWindowTouching: " << foundActiveTouchInCurScreen << " ,activeWindowMaximized: " << activeWindowMaximized(view); //qDebug() << "TRACKING | existsWindowActive: " << foundActiveInCurScreen << " , existsWindowMaximized:" << existsWindowMaximized(view) // << " , existsWindowTouching:"<enabled() || !m_layouts[layout]->isTrackingCurrentActivity()) { return; } bool foundActive{false}; bool foundActiveMaximized{false}; bool foundMaximized{false}; //! the notification window is not sending a remove signal and creates windows of geometry (0x0 0,0), //! maybe a garbage collector here is a good idea!!! bool existsFaultyWindow{false}; WindowId activeWinId; WindowId maxWinId; for (const auto &winfo : m_windows) { if (winfo.isPlasmaDesktop() || !inCurrentDesktopActivity(winfo)) { continue; } if (isActive(winfo)) { foundActive = true; activeWinId = winfo.wid(); if (winfo.isMaximized() && !winfo.isMinimized()) { foundActiveMaximized = true; maxWinId = winfo.wid(); } } if (!foundActiveMaximized && winfo.isMaximized() && !winfo.isMinimized()) { foundMaximized = true; maxWinId = winfo.wid(); } if (!existsFaultyWindow && winfo.geometry() == QRect(0, 0, 0, 0)) { existsFaultyWindow = true; } //qDebug() << "window geometry ::: " << winfo.geometry(); } if (existsFaultyWindow) { cleanupFaultyWindows(); } //! HACK: KWin Effects such as ShowDesktop have no way to be identified and as such //! create issues with identifying properly touching and maximized windows. BUT when //! they are enabled then NO ACTIVE window is found. This is a way to identify these //! effects trigerring and disable the touch flags. //! BUG: 404483 //! Disabled because it has fault identifications, e.g. when a window is maximized and //! Latte or Plasma are showing their View settings //foundMaximizedInCurScreen = foundMaximizedInCurScreen && foundActive; //foundTouchInCurScreen = foundTouchInCurScreen && foundActive; //! assign flags setExistsWindowActive(layout, foundActive); setActiveWindowMaximized(layout, foundActiveMaximized); setExistsWindowMaximized(layout, foundActiveMaximized || foundMaximized); //! update color schemes for active and touching windows setActiveWindowScheme(layout, (foundActive ? m_wm->schemesTracker()->schemeForWindow(activeWinId) : nullptr)); //! update LastActiveWindow if (foundActive) { m_layouts[layout]->setActiveWindow(activeWinId); } //! Debug //qDebug() << "TRACKING | SCREEN: " << view->positioner()->currentScreenId() << " , EDGE:" << view->location() << " , ENABLED:" << enabled(view); //qDebug() << "TRACKING | activeWindowTouching: " << foundActiveTouchInCurScreen << " ,activeWindowMaximized: " << activeWindowMaximized(view); //qDebug() << "TRACKING | existsWindowActive: " << foundActiveInCurScreen << " , existsWindowMaximized:" << existsWindowMaximized(view) // << " , existsWindowTouching:"< * Michail Vourlakos * * This file is part of Latte-Dock * * Latte-Dock is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Latte-Dock is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.1 import QtQuick.Window 2.2 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.latte 0.2 as Latte Window{ width: mainGrid.width + 10 height: Math.min(mainGrid.height+10, Screen.height - visibilityManager.thicknessNormalOriginal) visible: true property string space:" : " PlasmaExtras.ScrollArea { id: scrollArea anchors.fill: parent verticalScrollBarPolicy: Qt.ScrollBarAsNeeded horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff flickableItem.flickableDirection: Flickable.VerticalFlick Grid{ id:mainGrid columns: 2 Text{ text: "Screen id"+space } Text{ text: latteView && latteView.positioner ? latteView.positioner.currentScreenName : "___" } Text{ text: "Screen Geometry"+space } Text{ text: { if (latteView && latteView.screenGeometry){ return latteView.screenGeometry.x+","+latteView.screenGeometry.y+ " "+latteView.screenGeometry.width+"x"+latteView.screenGeometry.height; } else { return "_,_ _x_"; } } } Text{ text: "Window Geometry"+space } Text{ text: { if (latteView) { return latteView.x + "," + latteView.y + " "+latteView.width+ "x"+latteView.height; } else { return "_,_ _x_"; } } } Text{ text: "On Primary"+space } Text{ text: { if (latteView && latteView.onPrimary) return "Yes"; else return "No"; } } Text{ text: " ----------- " } Text{ text: " ----------- " } Text{ text: "Contents Width"+space } Text{ text: layoutsContainer.contentsWidth } Text{ text: "Contents Height"+space } Text{ text: layoutsContainer.contentsHeight } Text{ text: "Max Length (user)"+space } Text{ text: plasmoid.configuration.maxLength +"%" } Text{ text: "Max Length (pixels)"+space } Text{ text: root.maxLength } Text{ text: "Offset (pixels)"+space } Text{ text: root.offset } Text{ text: "Mask"+space } Text{ text: { if (latteView && latteView.effects && latteView.effects.mask) { return latteView.effects.mask.x +", "+ latteView.effects.mask.y+" "+latteView.effects.mask.width+"x"+latteView.effects.mask.height; } else { return "_,_ _x_"; } } } Text{ text: "Absolute Geometry"+space } Text{ text: { if (latteView && latteView.absoluteGeometry) { return latteView.absoluteGeometry.x + ", " + latteView.absoluteGeometry.y + " " + latteView.absoluteGeometry.width + "x" + latteView.absoluteGeometry.height; } else { return "_,_ _x_"; } } } Text{ text: "Local Geometry"+space } Text{ text: { if (latteView && latteView.localGeometry) { return latteView.localGeometry.x + ", " + latteView.localGeometry.y + " " + latteView.localGeometry.width + "x" + latteView.localGeometry.height; } else { return "_,_ _x_"; } } } Text{ text: "Draw Effects"+space } Text{ text: { if (latteView && latteView.effects && latteView.effects.drawEffects) return "Yes"; else return "No"; } } Text{ text: "Effects Area"+space } Text{ text: { if (latteView && latteView.effects && latteView.effects.rect) { return latteView.effects.rect.x + ", " + latteView.effects.rect.y + " " +latteView.effects.rect.width + "x" + latteView.effects.rect.height; } else { return "_,_ _x_"; } } } Text{ text: " ----------- " } Text{ text: " ----------- " } Text{ text: "Is Hidden (flag)"+space } Text{ text: { if (latteView && latteView.visibility && latteView.visibility.isHidden) return "Yes"; else return "No"; } } Text{ text: "Actions Block Hiding "+space } Text{ text: root.actionsBlockHiding } Text{ text: "Contains Mouse (flag)"+space } Text{ text: { if (latteView && latteView.visibility && latteView.visibility.containsMouse) return "Yes"; else return "No"; } } Text{ text: "Edit Mode"+space } Text{ text: { if (root.editMode) return "Yes"; else return "No"; } } Text{ text: " ----------- " } Text{ text: " ----------- " } Text{ text: "Location"+space } Text{ text: { switch(plasmoid.location){ case PlasmaCore.Types.LeftEdge: return "Left Edge"; break; case PlasmaCore.Types.RightEdge: return "Right Edge"; break; case PlasmaCore.Types.TopEdge: return "Top Edge"; break; case PlasmaCore.Types.BottomEdge: return "Bottom Edge"; break; } return " : " + plasmoid.location; } } Text{ text: "Alignment"+space } Text{ text: { switch(plasmoid.configuration.panelPosition){ case Latte.Types.Left: return "Left"; break; case Latte.Types.Right: return "Right"; break; case Latte.Types.Center: return "Center"; break; case Latte.Types.Top: return "Top"; break; case Latte.Types.Bottom: return "Bottom"; break; case Latte.Types.Justify: return "Justify"; break; } return " : " + plasmoid.configuration.panelPosition; } } Text{ text: "Visibility"+space } Text{ text: { if (!latteView || !latteView.visibility) return ""; switch(latteView.visibility.mode){ case Latte.Types.AlwaysVisible: return "Always Visible"; break; case Latte.Types.AutoHide: return "Auto Hide"; break; case Latte.Types.DodgeActive: return "Dodge Active"; break; case Latte.Types.DodgeMaximized: return "Dodge Maximized"; break; case Latte.Types.DodgeAllWindows: return "Dodge All Windows"; break; case Latte.Types.None: return "None"; break; } return " : " + latteView.visibility.mode; } } Text{ text: "Zoom Factor"+space } Text{ text: root.zoomFactor } Text{ text: " ----------- " } Text{ text: " ----------- " } Text{ text: "Icon Size (current)"+space } Text{ text: root.iconSize } Text{ text: "Icon Size (user)"+space } Text{ text: plasmoid.configuration.iconSize } Text{ text: "Icon Size (proportion)"+space } Text{ text: root.proportionIconSize } Text{ text: "Icon Size (auto decrease), Enabled"+space } Text{ text: root.autoDecreaseIconSize } Text{ text: "Icon Size (auto decrease)"+space } Text{ text: root.automaticIconSizeBasedSize } Text{ text: "Length Internal Margin (pixels)"+space } Text{ text: root.lengthIntMargin } Text{ text: "Length External Margin (pixels)"+space } Text{ text: root.lengthExtMargin } Text{ text: "Thickness Margin"+space } Text{ text: root.thickMargin } Text{ text: " ----------- " } Text{ text: " ----------- " } Text{ text: "Show Panel Background (user)"+space } Text{ text: { if (plasmoid.configuration.useThemePanel) return "Yes"; else return "No"; } } Text{ text: "Force Transparent Panel (auto)"+space } Text{ text: { if (root.forceTransparentPanel) return "Yes"; else return "No"; } } Text{ text: "Panel Background Length"+space } Text{ text: root.realPanelLength } Text{ text: "Panel Background Thickness(user)"+space } Text{ text: plasmoid.configuration.panelSize + "%" } Text{ text: "Panel Background Thickness(automatic)"+space } Text{ text: root.realPanelSize } Text{ text: "Panel Transparency"+space } Text{ text: root.panelTransparency + "%" } Text{ text: "Panel Shadows Active"+space } Text{ text: { if (root.panelShadowsActive) return "Yes"; else return "No"; } } Text{ text: "Panel Background Shadow"+space } Text{ text: root.panelShadow } Text{ text: "Panel Thickness Margin High"+space } Text{ text: root.panelThickMarginHigh } Text{ text: " ----------- " } Text{ text: " ----------- " } Text{ text: "Mask - Normal Thickness"+space } Text{ text: visibilityManager.thicknessNormal } Text{ text: "Thickness Uses Panel Size"+space } Text{ text: visibilityManager.panelIsBiggerFromIconSize } Text{ text: "Behave As Plasma Panel"+space } Text{ text: { if (root.behaveAsPlasmaPanel) return "Yes"; else return "No"; } } Text{ text: "Draw Shadows (external)"+space } Text{ text: { if (root.drawShadowsExternal) return "Yes"; else return "No"; } } Text{ text: " ----------- " } Text{ text: " ----------- " } Text{ text: "Applet Hovered"+space } Text{ text: layoutsContainer.hoveredIndex } Text{ text: "Task Hovered"+space } Text{ text: root.latteAppletHoveredIndex } Text{ text: "In Normal State"+space } Text{ text: visibilityManager.normalState } Text{ text: "Animations Both Axis"+space } Text{ text: root.animationsNeedBothAxis } Text{ text: "Animations Only Length"+space } Text{ text: root.animationsNeedLength } Text{ text: "Animations Need Thickness"+space } Text{ text: root.animationsNeedThickness } Text{ text: " ----------- " } Text{ text: " ----------- " } Text{ text: "Start Layout Shown Applets"+space } Text{ text: layoutsContainer.startLayout.shownApplets } Text{ text: "Start Layout Applets (with fill)"+space } Text{ text: layoutsContainer.startLayout.fillApplets } Text{ text: "Start Layout Size (no fill applets)"+space } Text{ text: layoutsContainer.startLayout.sizeWithNoFillApplets+" px." } Text{ text: " ----------- " } Text{ text: " ----------- " } Text{ text: "Main Layout Shown Applets"+space } Text{ text: layoutsContainer.mainLayout.shownApplets } Text{ text: "Main Layout Applets (with fill)"+space } Text{ text: layoutsContainer.mainLayout.fillApplets } Text{ text: "Main Layout Size (no fill applets)"+space } Text{ text: layoutsContainer.mainLayout.sizeWithNoFillApplets+" px." } Text{ text: " ----------- " } Text{ text: " ----------- " } Text{ text: "End Layout Shown Applets"+space } Text{ text: layoutsContainer.endLayout.shownApplets } Text{ text: "End Layout Applets (with fill)"+space } Text{ text: layoutsContainer.endLayout.fillApplets } Text{ text: "End Layout Size (no fill applets)"+space } Text{ text: layoutsContainer.endLayout.sizeWithNoFillApplets+" px." } Text{ text: " ----------- " } Text{ text: " ----------- " } Text{ text: "Applets need Windows Tracking"+space } Text{ text: root.appletsNeedWindowsTracking } Text{ text: "Last Active Window Current Screen (id)"+space } Text{ - text: latteView && latteView.windowsTracker ? latteView.windowsTracker.currentScreen.lastActiveWindow.winId : "--" + text: latteView && latteView.windowsTracker && latteView.windowsTracker.currentScreen.lastActiveWindow.isValid ? + latteView.windowsTracker.currentScreen.lastActiveWindow.winId : "--" } Text{ text: "Last Active Window Current Screen (title)"+space } Text{ - text: latteView && latteView.windowsTracker ? latteView.windowsTracker.currentScreen.lastActiveWindow.display : "--" + text: latteView && latteView.windowsTracker && latteView.windowsTracker.currentScreen.lastActiveWindow.isValid ? + latteView.windowsTracker.currentScreen.lastActiveWindow.display : "--" elide: Text.ElideRight } Text{ text: "Last Active Window All Screens (id)"+space } Text{ - text: latteView && latteView.windowsTracker ? latteView.windowsTracker.allScreens.lastActiveWindow.winId : "--" + text: latteView && latteView.windowsTracker && latteView.windowsTracker.allScreens.lastActiveWindow.isValid ? + latteView.windowsTracker.allScreens.lastActiveWindow.winId : "--" } Text{ text: "Last Active Window All Screens (title)"+space } Text{ - text: latteView && latteView.windowsTracker ? latteView.windowsTracker.allScreens.lastActiveWindow.display : "--" + text: latteView && latteView.windowsTracker && latteView.windowsTracker.allScreens.lastActiveWindow.isValid ? + latteView.windowsTracker.allScreens.lastActiveWindow.display : "--" elide: Text.ElideRight } } } }