From 4d316007af0dea08d92bfc6fdd4b61352526cae1 Mon Sep 17 00:00:00 2001 From: bbedward Date: Tue, 10 Feb 2026 23:25:54 -0500 Subject: [PATCH] lock: add lock at startup action, not sure how to handle it in crash scenarios launcher v2: fix state reset in section changes fixes #1648 --- quickshell/Common/SettingsData.qml | 1 + quickshell/Common/settings/SettingsSpec.js | 1 + quickshell/Modals/DankLauncherV2/ResultsList.qml | 8 +++++--- quickshell/Modules/Lock/Lock.qml | 3 ++- quickshell/Modules/Settings/LockScreenTab.qml | 9 +++++++++ 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/quickshell/Common/SettingsData.qml b/quickshell/Common/SettingsData.qml index 6956673a..dc6a9b7e 100644 --- a/quickshell/Common/SettingsData.qml +++ b/quickshell/Common/SettingsData.qml @@ -483,6 +483,7 @@ Singleton { property bool lockScreenShowPasswordField: true property bool lockScreenShowMediaPlayer: true property bool lockScreenPowerOffMonitorsOnLock: false + property bool lockAtStartup: false property bool enableFprint: false property int maxFprintTries: 15 diff --git a/quickshell/Common/settings/SettingsSpec.js b/quickshell/Common/settings/SettingsSpec.js index f8144eee..7e3a86bd 100644 --- a/quickshell/Common/settings/SettingsSpec.js +++ b/quickshell/Common/settings/SettingsSpec.js @@ -310,6 +310,7 @@ var SPEC = { lockScreenShowPasswordField: { def: true }, lockScreenShowMediaPlayer: { def: true }, lockScreenPowerOffMonitorsOnLock: { def: false }, + lockAtStartup: { def: false }, enableFprint: { def: false }, maxFprintTries: { def: 15 }, fprintdAvailable: { def: false, persist: false }, diff --git a/quickshell/Modals/DankLauncherV2/ResultsList.qml b/quickshell/Modals/DankLauncherV2/ResultsList.qml index 2cab9bf2..9a3ca99d 100644 --- a/quickshell/Modals/DankLauncherV2/ResultsList.qml +++ b/quickshell/Modals/DankLauncherV2/ResultsList.qml @@ -112,6 +112,11 @@ Item { function onViewModeVersionChanged() { Qt.callLater(root._rebuildVisualModel); } + function onSearchModeChanged() { + root._visualRows = []; + root._cumulativeHeights = []; + root._flatIndexToRowMap = {}; + } } function resetScroll() { @@ -355,9 +360,6 @@ Item { readonly property int versionTrigger: root.controller?.viewModeVersion ?? 0 readonly property var stickyHeaderSection: { - if (!root.controller?.sections || root.controller.sections.length === 0) - return null; - var scrollY = mainListView.contentY - mainListView.originY; if (scrollY <= 0) return null; diff --git a/quickshell/Modules/Lock/Lock.qml b/quickshell/Modules/Lock/Lock.qml index 99cc3032..5a3c6707 100644 --- a/quickshell/Modules/Lock/Lock.qml +++ b/quickshell/Modules/Lock/Lock.qml @@ -43,6 +43,8 @@ Scope { Component.onCompleted: { IdleService.lockComponent = this; + if (SettingsData.lockAtStartup) + lock(); } function notifyLoginctl(lockAction: bool) { @@ -204,7 +206,6 @@ Scope { } LockScreenDemo { - id: demoWindow } diff --git a/quickshell/Modules/Settings/LockScreenTab.qml b/quickshell/Modules/Settings/LockScreenTab.qml index ceccc633..98584555 100644 --- a/quickshell/Modules/Settings/LockScreenTab.qml +++ b/quickshell/Modules/Settings/LockScreenTab.qml @@ -148,6 +148,15 @@ Item { onToggled: checked => SettingsData.set("lockScreenPowerOffMonitorsOnLock", checked) } + SettingsToggleRow { + settingKey: "lockAtStartup" + tags: ["lock", "screen", "startup", "start", "boot", "login", "automatic"] + text: I18n.tr("Lock at startup") + description: I18n.tr("Automatically lock the screen when DMS starts") + checked: SettingsData.lockAtStartup + onToggled: checked => SettingsData.set("lockAtStartup", checked) + } + SettingsToggleRow { settingKey: "enableFprint" tags: ["lock", "screen", "fingerprint", "authentication", "biometric", "fprint"]