From 7cb6ebaae141f2d92745529802c7aa65def55dee Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Mon, 4 Mar 2024 13:12:34 -0500 Subject: [PATCH] taskswitcher: Remove all interaction restrictions while the task switcher is opening This allows users to properly interact (open apps, dismiss) while the task switcher is in its opening animation. This fixes tapping on an app while the task switcher is opening dismissing the task switcher entirely (due to race condition) --- kwin/mobiletaskswitcher/qml/Task.qml | 3 +-- kwin/mobiletaskswitcher/qml/TaskList.qml | 4 +--- kwin/mobiletaskswitcher/qml/TaskSwitcherState.qml | 4 ++++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/kwin/mobiletaskswitcher/qml/Task.qml b/kwin/mobiletaskswitcher/qml/Task.qml index 1172a236..83257b77 100644 --- a/kwin/mobiletaskswitcher/qml/Task.qml +++ b/kwin/mobiletaskswitcher/qml/Task.qml @@ -57,7 +57,6 @@ Item { id: control width: parent.width height: parent.height - enabled: !taskSwitcher.taskSwitcherState.currentlyBeingOpened // set cursor shape here, since taphandler seems to not be able to do it cursorShape: Qt.PointingHandCursor @@ -70,7 +69,7 @@ Item { } onClicked: { - if (!taskSwitcher.taskSwitcherState.currentlyBeingOpened && !passedDragThreshold) { + if (!passedDragThreshold) { delegate.activateApp(); } } diff --git a/kwin/mobiletaskswitcher/qml/TaskList.qml b/kwin/mobiletaskswitcher/qml/TaskList.qml index bc3ff655..a1a9f7c5 100644 --- a/kwin/mobiletaskswitcher/qml/TaskList.qml +++ b/kwin/mobiletaskswitcher/qml/TaskList.qml @@ -76,9 +76,7 @@ MouseArea { onClicked: { // if tapped on the background, then hide - if (!taskSwitcherState.currentlyBeingOpened) { - taskSwitcher.hide(); - } + taskSwitcher.hide(); } onPressedChanged: { diff --git a/kwin/mobiletaskswitcher/qml/TaskSwitcherState.qml b/kwin/mobiletaskswitcher/qml/TaskSwitcherState.qml index 8d4fb6cc..7998e344 100644 --- a/kwin/mobiletaskswitcher/qml/TaskSwitcherState.qml +++ b/kwin/mobiletaskswitcher/qml/TaskSwitcherState.qml @@ -136,6 +136,10 @@ QtObject { } function openApp(index, window) { + // cancel any opening animations ongoing + currentlyBeingOpened = false; + cancelAnimations(); + animateGoToTaskIndex(index, Kirigami.Units.shortDuration); openAppAnim.restart(); KWinComponents.Workspace.activeWindow = window