Repository navigation
Conversation
splitshotz
left a comment
There was a problem hiding this comment.
Thanks for this, it's a lot of careful work, and CI is green. I ran it merged onto main with a real process standing in for a game: start, stop after exit, the kept file, and the manual-stop memory surviving a restart all worked. Three things need fixing before I can merge it.
Needs fixing:
-
One failed window scan at a manual stop turns auto-start off until Vice restarts.
_change_sessionsets the "state" error, that sets_auto_start_state_blocked, and nothing ever clears it. I reproduced it: manual session, onescan_game_windowsreturningNoneat the stop, and after that a running game never starts a session, even after switching the setting off and on. A damaged or old-versionsession_auto_start.jsondoes the same on every start, because the file is never rewritten. A failed scan should mean "suppress nothing", the block should clear on the next successful save or when the setting is toggled, and an unreadable state file should be logged and replaced with an empty one. -
The KDE adapter changes for everyone, including people who never turn this on.
_get_active_window_kdenow makes three kdotool calls instead of two, and when kdotool finds no window it returns the X11 answer instead ofNone. On main thatNonegoes to the visible-window scan. XWayland's idea of focus on KDE is often stale, so this can tag a clip, set Discord presence or block a hotkey for a window that isn't focused. Please take it out of this PR. If it fixes something real, send it separately with the case it fixes. -
The KDE scan needs kdotool 0.3.0.
kdotool kwinscript --inlinewas added in 0.3.0 (September) and doesn't exist in 0.2.2. On the older one, every 2 second tick runs a kdotool that fails, then falls back to wmctrl, which only sees XWayland windows, and Settings still says the feature is supported. Please probe for it once, cache the answer, and report it as unavailable when it's missing.
Smaller:
_scan_x11_game_windowstreats "wmctrl ran and listed nothing" as "no games".list_candidate_windowson main falls back to xdotool in that case. On Hyprland here wmctrl lists 0 windows while xdotool sees 71.- The xdotool fallback runs two processes per window every 2 seconds. With 71 windows that's about 140 spawns per tick. It needs a cheaper path or a slower interval when it's on the fallback.
- With both settings off, every session start logs "Automatic session stopping is off.", and the detection-failure message now says "automatic stopping unavailable" even when the feature is off. Please keep the off case as quiet as it is on main.
- The copy is too long for Settings. Each help line should be one short sentence about what the switch does, without how it works inside ("the game process that was active when the session started", the list of desktops). The three error notes and
sessionAutoStartFailedDetailneed the same treatment. - A game that starts through a launcher splits the session: the window's first process exits while the game keeps running, the session stops after 5 seconds and a second one starts. Both files are kept, so nothing is lost, but it should follow the process tree or at least be a documented limit.
Mine to decide, no action needed from you yet:
- It's unavailable on Hyprland, Sway and Niri, and the switch is still offered there and only says so after saving. I'd want it disabled up front on those, like "Follow mouse" is, or scanners for them (
hyprctl clients -jandswaymsg -t get_treewould do it). - With only "start" on, a session keeps recording the desktop after the game closes. I lean towards a session that Vice started always stopping with its game.
- After an automatic stop, a double-tap out of habit starts a new session.
I'll look at #306 again once this is in, since it sits on top.
Remove redundant information about automatic session stopping.
This reverts commit ab5c570.
Repair owned unreadable suppression files through the existing atomic save path while retaining known identities and diagnostic backups. Keep transient storage errors fail-closed. Skip manual-stop discovery and persistence when automatic starts are disabled, including changes while scanning or awaiting the persistence lock. Add normal-user permission and concurrency regression coverage.
Summary
Vice can now automatically record a full game session, similar to Medal’s Long Recording: start when a game is detected, mark highlights while playing, and save when the game closes. Vice starts after it detects a recognized game window and stops five seconds after the original game process exits.
Start session when a game is detected and Stop session when the game exits are separate options under Settings → Recording. Both default to off. Already-running and background games can trigger recording. A manual stop keeps that game instance stopped, even after restarting Vice, and another game cannot replace an active session.
Steam’s installed-app lookup can also recognize non-game software. An optional process exclusion list is proposed separately in #306.
Testing
main.