lid behavior watcher to lock session #115

Merged
zach merged 25 commits from lid-switch-behavior into main 2026-06-03 18:02:21 +02:00
5 changed files with 13 additions and 4 deletions
Showing only changes of commit 2920c57163 - Show all commits
-2
View File
@@ -26,8 +26,6 @@ add_compile_options(
if("plugin" IN_LIST ENABLE_MODULES)
add_subdirectory(Plugins)
add_custom_target(fix-cc
COMMAND sed -i "s/-mno-direct-extern-access/-fno-direct-access-external-data/g" "${CMAKE_BINARY_DIR}/compile_commands.json")
endif()
if("shell" IN_LIST ENABLE_MODULES)
-1
View File
@@ -1,5 +1,4 @@
import Quickshell
import ZShell
import QtQuick
Scope {
1
+8
View File
@@ -9,6 +9,7 @@ import qs.Components
Scope {
id: root
required property var lid
property alias lock: lock
property int seenOnce: 0
@@ -21,6 +22,13 @@ Scope {
onRequestLock: lock.locked = true
onUnlock: lock.locked = false
Connections {
target: root.lid
function onRequestLock(): void {
lock.locked = true
}
}
LockSurface {
id: lockSurface
-1
View File
@@ -32,7 +32,6 @@ class LidWatcher : public QObject {
LidState m_state = Opened;
void extracted();
void onPropertiesChanged(const QString& interface,
AramJonghu marked this conversation as resolved Outdated
Outdated
Review

extracted() is declared but never implemented in the .cpp file.

`extracted()` is declared but never implemented in the `.cpp` file.
const QVariantMap& changed,
const QStringList& invalidated);
+5
View File
@@ -35,6 +35,8 @@ ShellRoot {
Lock {
id: lock
lid: lid
}
Shortcuts {
@@ -48,7 +50,10 @@ ShellRoot {
}
LazyLoader {
id: lid
activeAsync: Config.lock.lidWatch && Battery.isLaptop
component: LidService {
onRequestLock: lock.lock.requestLock()
}