diff --git a/modules/lock/Lock.qml b/modules/lock/Lock.qml index 5d70266a..f852cb7f 100644 --- a/modules/lock/Lock.qml +++ b/modules/lock/Lock.qml @@ -1,5 +1,6 @@ pragma ComponentBehavior: Bound +import QtQuick import Quickshell import Quickshell.Io import Quickshell.Wayland @@ -25,6 +26,20 @@ Scope { lock: lock } + Loader { + asynchronous: true + active: true + onLoaded: active = false + + // Force a load of a screencopy so the one in the lock works + // My guess is the ICC backend loads async on first request, which if the lock is + // the first request it fails to capture (because it's async and the compositor + // refuses capture when locked) + sourceComponent: ScreencopyView { + captureSource: Quickshell.screens[0] + } + } + // qmllint disable unresolved-type CustomShortcut { // qmllint enable unresolved-type