Skip to content

Commit

Permalink
#30: sync by timer reverted
Browse files Browse the repository at this point in the history
  • Loading branch information
antroids committed Sep 27, 2024
1 parent 9f4d83a commit e22dc63
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions package/contents/ui/ActiveTasksModel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ TaskManager.TasksModel {
showingDesktop = false;
}
}
onShowingDesktopChanged: syncActiveTaskIndex()
}
property Timer syncActiveTaskTimer: Timer {
interval: 500
onTriggered: updateActiveTaskIndex()
triggeredOnStart: true
onShowingDesktopChanged: updateActiveTaskIndex()
}

function getInvalidIndex() {
Expand Down Expand Up @@ -67,10 +62,6 @@ TaskManager.TasksModel {
activeWindow.update();
}

function syncActiveTaskIndex() {
syncActiveTaskTimer.restart();
}

function filterTask(index) {
if (!index || !index.valid)
return false;
Expand All @@ -90,15 +81,15 @@ TaskManager.TasksModel {
filterNotMaximized: plasmoid.configuration.widgetActiveTaskSource == ActiveTasksModel.ActiveTaskSource.LastActiveMaximized
onDataChanged: function (from, to, roles) {
if (hasActiveWindow && activeTaskIndex >= from && activeTaskIndex <= to)
syncActiveTaskIndex();
updateActiveTaskIndex();
else if (!hasActiveWindow && getFirstRowIndex() >= from && getFirstRowIndex() <= to)
syncActiveTaskIndex();
updateActiveTaskIndex();
}
onActiveTaskChanged: syncActiveTaskIndex()
onCountChanged: syncActiveTaskIndex()
onActiveTaskChanged: updateActiveTaskIndex()
onCountChanged: updateActiveTaskIndex()
sortMode: TaskManager.TasksModel.SortLastActivated
groupMode: TaskManager.TasksModel.GroupDisabled
Component.onCompleted: syncActiveTaskIndex()
Component.onCompleted: updateActiveTaskIndex()

virtualDesktopInfo: TaskManager.VirtualDesktopInfo {}

Expand Down

0 comments on commit e22dc63

Please sign in to comment.