From 04d4670f933431f5deaad4b2045baeccc2a4494e Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 23 Aug 2026 11:59:36 +0800 Subject: fix: don't set priority to -1 when indexOf returns that --- popups/launcher/components/IComponent.qml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'popups/launcher/components/IComponent.qml') diff --git a/popups/launcher/components/IComponent.qml b/popups/launcher/components/IComponent.qml index 4333998..e06ed98 100644 --- a/popups/launcher/components/IComponent.qml +++ b/popups/launcher/components/IComponent.qml @@ -64,6 +64,13 @@ IRect { return state.priorities.indexOf(root); } + function trySetSelfPriority() { + let self = getSelfPriority(); + // ??? why tf is it -1 not null or undefined this is why rust is better + if (self !== -1) + state.selectedPriority = self; + } + // this doesn't change launcher size but only hides the actual content but the outside still think the content is there visible: active opacity: valid ? 1 : 0 @@ -98,13 +105,14 @@ IRect { HoverHandler { onHoveredChanged: { if (hovered) - root.state.selectedPriority = root.getSelfPriority(); + root.trySetSelfPriority(); } } - Component.onCompleted: { - Qt.callLater(() => { - syncSelectionState(); - }); - } + // causes all of them fighting for selection state + // Component.onCompleted: { + // Qt.callLater(() => { + // syncSelectionState(); + // }); + // } } -- cgit v1.2.3