From 02bc67af81acf0f6bd37685b05599312a3790365 Mon Sep 17 00:00:00 2001 From: Yari Polla Date: Fri, 29 Apr 2022 01:39:29 +0200 Subject: [PATCH] taskswitcher: add delay for tasks reordering --- .../mobileshell/qml/taskswitcher/Task.qml | 1 + .../qml/taskswitcher/TaskSwitcher.qml | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/components/mobileshell/qml/taskswitcher/Task.qml b/components/mobileshell/qml/taskswitcher/Task.qml index 6578a060..d1455fa8 100644 --- a/components/mobileshell/qml/taskswitcher/Task.qml +++ b/components/mobileshell/qml/taskswitcher/Task.qml @@ -46,6 +46,7 @@ Item { } function activateApp() { + taskSwitcherState.wasInActiveTask = false; taskSwitcher.activateWindow(model.index); } //END functions diff --git a/components/mobileshell/qml/taskswitcher/TaskSwitcher.qml b/components/mobileshell/qml/taskswitcher/TaskSwitcher.qml index d4a0a4f2..806f2f84 100644 --- a/components/mobileshell/qml/taskswitcher/TaskSwitcher.qml +++ b/components/mobileshell/qml/taskswitcher/TaskSwitcher.qml @@ -73,6 +73,14 @@ Item { oldTasksCount = tasksCount; } + Timer { + id: reorderTimer + + interval: 5000 + + onTriggered: tasksModel.taskReorderingEnabled = true + } + //BEGIN functions function show(animation) { @@ -83,6 +91,9 @@ Item { taskSwitcherState.wasInActiveTask = tasksModel.activeTask.row >= 0; taskSwitcherState.currentlyBeingOpened = true; + reorderTimer.stop(); + tasksModel.taskReorderingEnabled = false; + // skip to first active task if (taskSwitcherState.wasInActiveTask) { taskSwitcherState.goToTaskIndex(tasksModel.activeTask.row); @@ -140,6 +151,12 @@ Item { } instantHide(); + + if (taskSwitcherState.wasInActiveTask) { + reorderTimer.restart(); + } else { + tasksModel.taskReorderingEnabled = true; + } } function minimizeAll() { @@ -156,6 +173,7 @@ Item { easing.type: Easing.InOutQuad onFinished: { root.visible = false; + tasksModel.taskReorderingEnabled = true; } }