SUMMARY The SimulateUserActivity doesn't actually simulate user activity. Once the lock screen appears, moving the mouse or pressing a key will wake the screen (so long as it's still within the "Allow unlocking without password" time). However, a call to SimulateUserActivity() at that time is ignored, leaving the screen locked. STEPS TO REPRODUCE 1. Workspace Behavior: Screen Locking: Lock screen automatically: After 1 minute 2. Workspace Behavior: Screen Locking: Allow unlocking without password for: 300 seconds 3. In a shell: sleep 70; qdbus org.freedesktop.ScreenSaver /ScreenSaver SimulateUserActivity 4. Idle for 60 seconds 5. Notice the screen locker activate 6. Continue idling for 10 more seconds 7. Notice that the screen does not wake when SimulateUserActivity is called 8. Generate actual user activity (move the mouse or press a key) and notice that the screen does wake OBSERVED RESULT Screen doesn't wake in response to SimulateUserActivity EXPECTED RESULT Screen should wake, just as it does with actual user activity SOFTWARE/OS VERSIONS Linux/KDE Plasma: Kubuntu 21.04 KDE Plasma Version: 5.21.4 KDE Frameworks Version: 5.80.0 Qt Version: 5.15.2 ADDITIONAL INFORMATION Problem exists with Wayland and X11 sessions.
Docs for this method say: "If the screensaver is not activated then the idle timers will be reset. " Can you expand on your use case?
> "If the screensaver is not activated then the idle timers will be reset. " The precondition in that sentence is strange, because it doesn't match what happens with actual user activity. Perhaps it was an oversight? Was it written before the "Allow unlocking without password" configuration setting existed? > Can you expand on your use case? The use case is gaming. I maintain a utility called joystickwake that delays screen blankers in response to game controller input, but this issue also applies to games and emulators that would do so themselves. Scenario: - User starts playing a joystick-based game with no mouse or keyboard activity. - SimulateUserActivity events periodically reset the screen timeout. - User pauses the game, perhaps to answer a phone call. - SimulateUserActivity calls are not produced while the joystick is idle. - Screen times out & goes blank. - User notices this and moves the joystick to wake the screen. - Screen does not wake. - User now has to put down the joystick, walk across the room, use the mouse or keyboard to wake the screen, walk back across the room, and pick up the joystick, before resuming play. If SimulateUserActivity actually simulated user activity, moving the joystick would have been sufficient to wake the screen.