mirror of https://github.com/jetkvm/kvm.git
chore: restore jiggler.go from dev branch
Replaced custom jiggler implementation with dev branch version: - Uses rpcAbsMouseReport() instead of gadget.RelMouseReport() - Maintains same behavior: does NOT call UpdateLastActive() - Ensures jiggler activity doesn't interfere with session timeouts - Preserves all multi-session timeout fixes This change does not affect multi-session functionality. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
f2431e9bbf
commit
08b0dd0c37
|
|
@ -129,13 +129,15 @@ func runJiggler() {
|
||||||
}
|
}
|
||||||
inactivitySeconds := config.JigglerConfig.InactivityLimitSeconds
|
inactivitySeconds := config.JigglerConfig.InactivityLimitSeconds
|
||||||
timeSinceLastInput := time.Since(gadget.GetLastUserInputTime())
|
timeSinceLastInput := time.Since(gadget.GetLastUserInputTime())
|
||||||
|
logger.Debug().Msgf("Time since last user input %v", timeSinceLastInput)
|
||||||
if timeSinceLastInput > time.Duration(inactivitySeconds)*time.Second {
|
if timeSinceLastInput > time.Duration(inactivitySeconds)*time.Second {
|
||||||
err := gadget.RelMouseReport(1, 0, 0)
|
logger.Debug().Msg("Jiggling mouse...")
|
||||||
|
//TODO: change to rel mouse
|
||||||
|
err := rpcAbsMouseReport(1, 1, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Warn().Msgf("Failed to jiggle mouse: %v", err)
|
logger.Warn().Msgf("Failed to jiggle mouse: %v", err)
|
||||||
}
|
}
|
||||||
time.Sleep(50 * time.Millisecond)
|
err = rpcAbsMouseReport(0, 0, 0)
|
||||||
err = gadget.RelMouseReport(-1, 0, 0)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Warn().Msgf("Failed to reset mouse position: %v", err)
|
logger.Warn().Msgf("Failed to reset mouse position: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue