Closed psifidotos closed 5 years ago
@psifidotos Using Plasma 5.14, I tried installing the package with your changes but to no effect, still have to do more than open/click a window to activate.
EDIT: I think it was just a matter of restarting the computer. It's working!
I think it should be a pull request, not issue (works for me btw)
The differences are:
activeWindowModel.onDataChanged
to onCountChanged: updateActiveWindowInfo();
, which probably only triggers when a new window is opened. I'll leave the onDataChanged
trigger as well.onActiveTaskChanged: { activeWindowModel.sourceModel = tasksModel }
to Component.onCompleted
which I've no idea why I didn't have in the first place... Unless it forced the model to refresh it's "IsActive" property... hmmm. It seems to work with your code though so I'll try it for a bit.diff --git a/inactiveblur/package/contents/ui/WindowModel.qml b/inactiveblur/package/contents/ui/WindowModel.qml
index 6359b61..462758c 100644
--- a/inactiveblur/package/contents/ui/WindowModel.qml
+++ b/inactiveblur/package/contents/ui/WindowModel.qml
@@ -21,29 +21,27 @@ Item {
activity: activityInfo.currentActivity
virtualDesktop: virtualDesktopInfo.currentDesktop
- screenGeometry: wallpaper.screenGeometry // Warns "Unable to assign [undefined] to QRect" during init, but works thereafter.
+ screenGeometry: wallpaper.screenGeometry
filterByActivity: true
filterByVirtualDesktop: true
filterByScreen: true
onActiveTaskChanged: {
- activeWindowModel.sourceModel = tasksModel
updateActiveWindowInfo()
}
- onDataChanged: {
- updateActiveWindowInfo()
+
+ Component.onCompleted: {
+ activeWindowModel.sourceModel = tasksModel;
}
}
PlasmaCore.SortFilterModel {
id: activeWindowModel
filterRole: 'IsActive'
filterRegExp: 'true'
- sourceModel: tasksModel
- onDataChanged: updateActiveWindowInfo()
+ onCountChanged: updateActiveWindowInfo();
}
-
function activeTask() {
return activeWindowModel.get(0) || {}
}
@@ -51,7 +49,5 @@ Item {
function updateActiveWindowInfo() {
var actTask = activeTask()
noWindowActive = activeWindowModel.count === 0 || actTask.IsActive !== true
- currentWindowMaximized = !noWindowActive && actTask.IsMaximized === true
- isActiveWindowPinned = actTask.VirtualDesktop === -1;
}
}
Both mentioned changes are in v2.
In my system, plasma 5.13 when the user was activating a window with a single click the desktop blurring wasnt activated, the user had to drag the window around. I fixed it by changing the WindowsModel.qml code: