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)
This commit is contained in:
Devin Lin 2024-03-04 13:12:34 -05:00
parent b5e58a8db1
commit 7cb6ebaae1
3 changed files with 6 additions and 5 deletions

View file

@ -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();
}
}

View file

@ -76,9 +76,7 @@ MouseArea {
onClicked: {
// if tapped on the background, then hide
if (!taskSwitcherState.currentlyBeingOpened) {
taskSwitcher.hide();
}
taskSwitcher.hide();
}
onPressedChanged: {

View file

@ -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