无法检测到 gnome 会话中可靠的屏幕锁定

无法检测到 gnome 会话中可靠的屏幕锁定

我必须检测屏幕是否已锁定。大多数情况下它工作正常。但是:在右上角的菜单中选择“锁定屏幕”(德语:“Sperren”),然后直接移动鼠标会导致

  • 锁定的屏幕
  • 屏幕没有关闭
  • 会话未被检测为“锁定”
    • gnome-screensaver-command --query
    • dbus-send --session --dest=org.gnome.ScreenSaver --print-reply=literal /org/gnome/ScreenSaver org.gnome.ScreenSaver.GetActive
    • loginctl show-session 2(2 通过 确定loginctl list-sessions

知道如何在这种情况下检测屏幕锁定吗?我正在使用 ubuntu 20.04 和 22.04

无需鼠标移动即可锁定屏幕

屏幕已关闭

2022-07-09_14:13:02 'gnome-screensaver.sh:boolean false' 'loginctl:Active=yes State=active IdleHint=no IdleSinceHint=1657368161096140 IdleSinceHintMonotonic=104647751555 LockedHint=no' 'xset:Monitor is On' 'gnome-screensaver-command:The screensaver is inactive' -
2022-07-09_14:13:12 'gnome-screensaver.sh:boolean true' 'loginctl:Active=yes State=active IdleHint=yes IdleSinceHint=1657368789735058 IdleSinceHintMonotonic=105276390473 LockedHint=yes' 'xset:Monitor is Off' 'gnome-screensaver-command:The screensaver is active' 628638918
2022-07-09_14:13:22 'gnome-screensaver.sh:boolean true' 'loginctl:Active=yes State=active IdleHint=no IdleSinceHint=1657368801998928 IdleSinceHintMonotonic=105288654344 LockedHint=yes' 'xset:Monitor is On' 'gnome-screensaver-command:The screensaver is active' 12263871
2022-07-09_14:13:32 'gnome-screensaver.sh:boolean false' 'loginctl:Active=yes State=active IdleHint=no IdleSinceHint=1657368801998928 IdleSinceHintMonotonic=105288654344 LockedHint=no' 'xset:Monitor is On' 'gnome-screensaver-command:The screensaver is inactive' -

通过鼠标移动锁定屏幕

屏幕不是关掉

2022-07-09_14:14:18 'gnome-screensaver.sh:boolean false' 'loginctl:Active=yes State=active IdleHint=no IdleSinceHint=1657368801998928 IdleSinceHintMonotonic=105288654344 LockedHint=no' 'xset:Monitor is On' 'gnome-screensaver-command:The screensaver is inactive' -
2022-07-09_14:14:28 'gnome-screensaver.sh:boolean false' 'loginctl:Active=yes State=active IdleHint=no IdleSinceHint=1657368801998928 IdleSinceHintMonotonic=105288654344 LockedHint=no' 'xset:Monitor is On' 'gnome-screensaver-command:The screensaver is inactive' -
2022-07-09_14:14:38 'gnome-screensaver.sh:boolean false' 'loginctl:Active=yes State=active IdleHint=no IdleSinceHint=1657368801998928 IdleSinceHintMonotonic=105288654344 LockedHint=no' 'xset:Monitor is On' 'gnome-screensaver-command:The screensaver is inactive' -
2022-07-09_14:14:48 'gnome-screensaver.sh:boolean false' 'loginctl:Active=yes State=active IdleHint=no IdleSinceHint=1657368801998928 IdleSinceHintMonotonic=105288654344 LockedHint=no' 'xset:Monitor is On' 'gnome-screensaver-command:The screensaver is inactive' -

相关内容