summaryrefslogtreecommitdiff
path: root/popups/launcher/components/SelectionState.qml
diff options
context:
space:
mode:
Diffstat (limited to 'popups/launcher/components/SelectionState.qml')
-rw-r--r--popups/launcher/components/SelectionState.qml17
1 files changed, 6 insertions, 11 deletions
diff --git a/popups/launcher/components/SelectionState.qml b/popups/launcher/components/SelectionState.qml
index 7180129..d8055d6 100644
--- a/popups/launcher/components/SelectionState.qml
+++ b/popups/launcher/components/SelectionState.qml
@@ -36,17 +36,12 @@ Singleton {
priorities.sort((a, b) => (widgets.indexOf(a) - widgets.indexOf(b)) || 0);
- Qt.callLater(() => {
- let prevSelectedPriority = selectedPriority;
- while (!priorities[selectedPriority] && selectedPriority > 0) {
- if (prevSelectedPriority === selectedPriority) {
- Qt.callLater(() => {
- if (!priorities[selectedPriority] && selectedPriority > 0)
- selectedPriority--;
- priorities[selectedPriority]?.syncSelectionState();
- });
- }
- prevSelectedPriority = selectedPriority;
+ Qt.callLater(function step() {
+ if (!priorities[selectedPriority] && selectedPriority > 0) {
+ selectedPriority--;
+ Qt.callLater(step);
+ } else {
+ priorities[selectedPriority]?.syncSelectionState();
}
});
}