From ca19a60e5c67073489d0e2ee7e1b92da27018432 Mon Sep 17 00:00:00 2001 From: zach Date: Tue, 26 May 2026 13:03:46 +0200 Subject: [PATCH] temporary fix for focus being stolen even after release. Change to async loaders --- Drawers/Windows.qml | 2 +- Modules/Launcher/Wrapper.qml | 67 ++++++--------------------------- Modules/Wallpaper/Wallpaper.qml | 2 +- 3 files changed, 14 insertions(+), 57 deletions(-) diff --git a/Drawers/Windows.qml b/Drawers/Windows.qml index 37bd73c..ed91fda 100644 --- a/Drawers/Windows.qml +++ b/Drawers/Windows.qml @@ -35,7 +35,7 @@ Variants { property var root: Quickshell.shellDir WlrLayershell.exclusionMode: ExclusionMode.Ignore - WlrLayershell.keyboardFocus: visibilities.dock || visibilities.launcher || visibilities.sidebar || visibilities.dashboard || visibilities.settings || visibilities.resources ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None + // WlrLayershell.keyboardFocus: visibilities.dock || visibilities.launcher || visibilities.sidebar || visibilities.dashboard || visibilities.settings || visibilities.resources ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None color: "transparent" contentItem.focus: true mask: visibilities.isDrawing ? null : region diff --git a/Modules/Launcher/Wrapper.qml b/Modules/Launcher/Wrapper.qml index a7ababd..1e8b6d6 100644 --- a/Modules/Launcher/Wrapper.qml +++ b/Modules/Launcher/Wrapper.qml @@ -4,6 +4,7 @@ import Quickshell import QtQuick import qs.Components import qs.Config +import qs.Modules.Launcher.Services Item { id: root @@ -19,26 +20,17 @@ Item { max -= panels.popouts.nonAnimHeight; return max; } + property real offsetScale: shouldBeActive ? 0 : 1 required property var panels required property ShellScreen screen - required property PersistentProperties visibilities readonly property bool shouldBeActive: visibilities.launcher - property real offsetScale: shouldBeActive ? 0 : 1 + required property PersistentProperties visibilities - onShouldBeActiveChanged: { - if (shouldBeActive) { - implicitHeight = Qt.binding(() => content.implicitHeight); - timer.stop(); - } else { - implicitHeight = implicitHeight; - } - } - - visible: offsetScale < 1 anchors.bottomMargin: (-implicitHeight - 5) * offsetScale implicitHeight: content.implicitHeight implicitWidth: content.implicitWidth || 400 opacity: 1 - offsetScale + visible: offsetScale < 1 Behavior on offsetScale { Anim { @@ -47,61 +39,26 @@ Item { } } - onMaxHeightChanged: timer.start() - - Connections { - function onEnabledChanged(): void { - timer.start(); - } - - function onMaxShownChanged(): void { - timer.start(); - } - - target: Config.launcher - } - - Connections { - function onValuesChanged(): void { - if (DesktopEntries.applications.values.length < Config.launcher.maxAppsShown) - timer.start(); - } - - target: DesktopEntries.applications - } - - Timer { - id: timer - - interval: Appearance.anim.durations.small - - onRunningChanged: { - if (running && !root.shouldBeActive) { - content.visible = false; - content.active = true; - } else { - root.contentHeight = Math.min(root.maxHeight, content.implicitHeight); - content.active = Qt.binding(() => root.shouldBeActive || root.visible); - content.visible = true; - } - } + Component.onCompleted: Qt.callLater(() => Apps) + onShouldBeActiveChanged: { + if (shouldBeActive) + implicitHeight = Qt.binding(() => content.implicitHeight); + else + implicitHeight = implicitHeight; } Loader { id: content - active: false + active: root.shouldBeActive || root.visible anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top + asynchronous: true sourceComponent: Content { maxHeight: root.maxHeight panels: root.panels visibilities: root.visibilities - - Component.onCompleted: root.contentHeight = implicitHeight } - - Component.onCompleted: timer.start() } } diff --git a/Modules/Wallpaper/Wallpaper.qml b/Modules/Wallpaper/Wallpaper.qml index 9fac581..476fd29 100644 --- a/Modules/Wallpaper/Wallpaper.qml +++ b/Modules/Wallpaper/Wallpaper.qml @@ -6,7 +6,7 @@ import qs.Modules.DesktopIcons Loader { active: Config.background.enabled - asynchronous: true + asynchronous: false sourceComponent: Variants { model: Quickshell.screens