-
Notifications
You must be signed in to change notification settings - Fork 23
feat(agent): add window recording support via now proto dvc #1583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Let maintainers know that an action is required on their side
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds window recording support to the devolutions-session agent by implementing a window monitoring system that tracks active window changes on Windows systems. The implementation uses Windows Event Hooks to receive foreground window change notifications and optional polling to detect title changes within the same window.
Key Changes
- Added a new
window_monitormodule that uses Windows Event Hooks (SetWinEventHook) to monitor foreground window changes - Integrated window recording capabilities into the DVC task processing system with start/stop message handlers
- Updated the dependency on
now-proto-pduto use a Git branch for new window recording protocol messages
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| devolutions-session/src/dvc/window_monitor.rs | New module implementing window monitoring using Windows Event Hooks and optional polling for title changes, with async event handling through channels |
| devolutions-session/src/dvc/task.rs | Added window recording start/stop handlers, updated capabilities to include WINDOW_RECORDING flag, and integrated window recording events into the message processing loop |
| devolutions-session/src/dvc/process.rs | Extended ServerChannelEvent enum with WindowRecordingEvent variant for propagating window change events |
| devolutions-session/src/dvc/mod.rs | Added window_monitor module declaration |
| devolutions-session/Cargo.toml | Updated now-proto-pdu dependency to use Git branch and added Win32_UI_Accessibility feature for Windows API |
| Cargo.lock | Updated now-proto-pdu source to Git repository |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot open a new pull request to apply changes based on the comments in this thread |
|
@pacmancoder I've opened a new pull request, #1600, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: pacmancoder <3994505+pacmancoder@users.noreply.github.com>
…#1600) Addresses review feedback from PR #1583 on the window recording feature implementation. ### Dependency Management - Updated `now-proto-pdu` to use v0.4.2 from crates.io for stable, reproducible builds ### Task Lifecycle - Track window monitor task with `JoinHandle` and await completion on shutdown to prevent race conditions - Made `stop_window_recording` async to properly await task termination ### Code Quality - Removed redundant type annotation on `run_dvc_io` result - Extracted duplicate timestamp logic into `get_current_timestamp()` helper - Fixed module docs to clarify polling is used for title change detection ### Bug Fix - When title tracking is disabled, preserve previous title in snapshot to avoid missing actual window changes: ```rust // Before: updating full snapshot could mask process/exe_path changes last_snapshot = Some(snapshot); // After: preserve previous title when tracking disabled let prev_title = last_snapshot.as_ref().map_or_else(String::new, |s| s.title.clone()); last_snapshot = Some(WindowSnapshot { process_id: snapshot.process_id, exe_path: snapshot.exe_path.clone(), title: prev_title, }); ``` <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pacmancoder <3994505+pacmancoder@users.noreply.github.com>
8a56ad0 to
8ef6b83
Compare
Testing
|
305f497 to
92b4729
Compare
Adds window recording support to the Devolutions Agent. The implementation uses Windows event hooks to receive foreground window change notifications and optional polling to detect title changes within the same window.
Issue: ARC-353