diff --git a/containment/package/contents/ui/DebugWindow.qml b/containment/package/contents/ui/DebugWindow.qml index 28a2f4e41..fbc21275d 100644 --- a/containment/package/contents/ui/DebugWindow.qml +++ b/containment/package/contents/ui/DebugWindow.qml @@ -786,7 +786,7 @@ Window{ } Text{ - text: root.appletsNeedWindowsTracking + text: appletsRecords.windowsTrackingCount } Text{ diff --git a/containment/package/contents/ui/VisibilityManager.qml b/containment/package/contents/ui/VisibilityManager.qml index e69b99638..7f6672ac6 100644 --- a/containment/package/contents/ui/VisibilityManager.qml +++ b/containment/package/contents/ui/VisibilityManager.qml @@ -336,7 +336,7 @@ Item{ && !(latteView.visibility.mode === LatteCore.Types.AlwaysVisible /* Visibility */ || latteView.visibility.mode === LatteCore.Types.WindowsGoBelow || latteView.visibility.mode === LatteCore.Types.AutoHide)) - || root.appletsNeedWindowsTracking > 0 /*Applets Neew Windows Tracking */ + || appletsRecords.windowsTrackingCount > 0 /*Applets Need Windows Tracking */ || root.dragActiveWindowEnabled /*Dragging Active Window(Empty Areas)*/ || ((root.backgroundOnlyOnMaximized /*Dynamic Background */ || plasmoid.configuration.solidBackgroundForMaximized diff --git a/containment/package/contents/ui/abilities/AppletsRecords.qml b/containment/package/contents/ui/abilities/AppletsRecords.qml index afb35f6f9..edb446015 100644 --- a/containment/package/contents/ui/abilities/AppletsRecords.qml +++ b/containment/package/contents/ui/abilities/AppletsRecords.qml @@ -22,6 +22,7 @@ import QtQuick 2.0 Item { id: records + property int windowsTrackingCount: 0 //! number of applets requesting windows tracking property real maxInnerZoomFactor: 1.0 //! maximum inner zoom factor based on all applets property var applets: [] @@ -44,10 +45,14 @@ Item { if (ind>=0) { //! remove applets.splice(ind, 1); - updateInnerZoomFactor(); + updateValues(); } } + function addDefaultRecord(applet) { + applets.push({id: applet, innerZoomFactor: 1.0, windowsTrackingEnabled: false}); + } + function setInnerZoomFactor(applet, inner) { var len = applets.length; var ind = indexOf(applet); @@ -60,11 +65,35 @@ Item { } } else { //! add - applets.push({id: applet, innerZoomFactor: inner}); + addDefaultRecord(applet); + applets[len].innerZoomFactor = inner; updateInnerZoomFactor(); } } + function setWindowsTrackingEnabled(applet, value) { + var len = applets.length; + var ind = indexOf(applet); + + if (ind>=0) { + //! update + if(applets[ind].windowsTrackingEnabled !== value) { + applets[ind].windowsTrackingEnabled = value; + updateWindowsTrackingCount(); + } + } else { + //! add + addDefaultRecord(applet); + applets[len].windowsTrackingEnabled = value; + updateWindowsTrackingCount(); + } + } + + function updateValues() { + updateInnerZoomFactor(); + updateWindowsTrackingCount(); + } + function updateInnerZoomFactor() { var len = applets.length; var max = 1; @@ -77,4 +106,17 @@ Item { maxInnerZoomFactor = max; } + + function updateWindowsTrackingCount() { + var len = applets.length; + var cnt = 0; + + for (var i=0; i