Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cap desktop Linux setup#1635

Open
richiemcilroy wants to merge 5 commits intocursor/cap-linux-support-8d37from
cursor/cap-desktop-linux-setup-3766
Open

Cap desktop Linux setup#1635
richiemcilroy wants to merge 5 commits intocursor/cap-linux-support-8d37from
cursor/cap-desktop-linux-setup-3766

Conversation

@richiemcilroy
Copy link
Member

@richiemcilroy richiemcilroy commented Feb 27, 2026

Enable Cap desktop for Linux to record and edit by fixing module resolution and recording control interactivity.

The #start/app module resolution failed on case-sensitive filesystems, and Linux recording controls were unclickable due to issues with fake-window bounds and stale state, preventing recordings from stopping cleanly and transitioning to the editor.


Open in Web Open in Cursor 

Greptile Summary

This PR enables Linux support for the Cap desktop app by fixing two critical issues: module resolution and recording control interactivity.

Key Changes:

  • Fixed SolidStart #start/app resolution on case-sensitive Linux filesystems by adding lowercase app.tsx re-export
  • Made Linux recording controls clickable by setting set_ignore_cursor_events(false) in multiple locations
  • Enhanced bounds checking with dual local/global coordinate checks to handle platform differences
  • Fixed stale recording state by adding async check for is_recording_active_or_pending() when tray is clicked
  • Updated type definitions to support Linux platform and generic system diagnostics

Issues Found:

  • Tray visibility logic may execute prematurely when stopping recording from stale state (see tray.rs comment)

Confidence Score: 3/5

  • Safe to merge with minor logic issue in tray click handler
  • The changes correctly address Linux-specific platform issues with appropriate conditional compilation. However, the tray click handler has a timing issue where tray.set_visible(true) executes before confirming recording state, which could cause unexpected UI behavior when stopping recordings from stale state.
  • Pay attention to apps/desktop/src-tauri/src/tray.rs - verify tray visibility behavior when clicking to stop a recording

Important Files Changed

Filename Overview
apps/desktop/src-tauri/src/fake_window.rs Added Linux-specific logic to keep recording controls interactive and fixed bounds checking to support both local and global coordinate systems
apps/desktop/src-tauri/src/recording.rs Split clear_current_recording() call from pattern matching to prevent stale state issues
apps/desktop/src-tauri/src/tray.rs Added async check for pending recording state when tray clicked, but tray.set_visible(true) may execute prematurely
apps/desktop/src-tauri/src/windows.rs Added Linux-specific calls to make recording controls interactive on both reused and new windows
apps/desktop/src/app.tsx Added lowercase re-export to fix SolidStart #start/app module resolution on case-sensitive Linux filesystems
apps/desktop/src/utils/tauri.ts Updated type definitions to support Linux platform and replaced macOS-specific diagnostics with generic Linux fields

Last reviewed commit: e168467

cursoragent and others added 5 commits February 27, 2026 14:47
- Updated Rust toolchain from 1.83.0 to 1.93.1 for edition2024 support
- Installed libasound2-dev for ALSA audio support
- Created symlinks for FFmpeg multiarch headers (libswscale, libavcodec, libavformat, libavutil, libavfilter, libswresample, libavdevice)
- Set C_INCLUDE_PATH, CPLUS_INCLUDE_PATH, and LIBRARY_PATH for proper C++ toolchain detection

Linux desktop build now compiles and launches successfully, though frontend has module resolution issues preventing full UI functionality.

Co-authored-by: Richie McIlroy <[email protected]>
@cursor
Copy link

cursor bot commented Feb 27, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@richiemcilroy richiemcilroy marked this pull request as ready for review February 27, 2026 19:26
Comment on lines 113 to 124
let Some(windows) = map.get(window.label()) else {
#[cfg(target_os = "linux")]
if is_recording_controls {
window.set_ignore_cursor_events(false).ok();
} else {
window.set_ignore_cursor_events(true).ok();
}

#[cfg(not(target_os = "linux"))]
window.set_ignore_cursor_events(true).ok();
continue;
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Linux, is_recording_controls always continues at L106, so the #[cfg(target_os = "linux")] if is_recording_controls { ... } branch here is effectively dead. This reads a lot simpler as an unconditional set_ignore_cursor_events(true).

Suggested change
let Some(windows) = map.get(window.label()) else {
#[cfg(target_os = "linux")]
if is_recording_controls {
window.set_ignore_cursor_events(false).ok();
} else {
window.set_ignore_cursor_events(true).ok();
}
#[cfg(not(target_os = "linux"))]
window.set_ignore_cursor_events(true).ok();
continue;
};
let Some(windows) = map.get(window.label()) else {
window.set_ignore_cursor_events(true).ok();
continue;
};

Comment on lines +131 to 139
#[cfg(target_os = "linux")]
if is_recording_controls {
let _ = window.set_ignore_cursor_events(false);
} else {
let _ = window.set_ignore_cursor_events(true);
}

#[cfg(not(target_os = "linux"))]
let _ = window.set_ignore_cursor_events(true);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since is_recording_controls already continues above on Linux, this per-OS branching in the error path isn’t doing anything different. Collapsing it reduces branching in the 20fps loop.

Suggested change
#[cfg(target_os = "linux")]
if is_recording_controls {
let _ = window.set_ignore_cursor_events(false);
} else {
let _ = window.set_ignore_cursor_events(true);
}
#[cfg(not(target_os = "linux"))]
let _ = window.set_ignore_cursor_events(true);
let _ = window.set_ignore_cursor_events(true);

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +827 to 835
let app = app_handle.clone();
tokio::spawn(async move {
let state =
app.state::<Arc<tokio::sync::RwLock<App>>>().inner().clone();
if state.read().await.is_recording_active_or_pending() {
let _ = recording::stop_recording(app.clone(), app.state()).await;
}
});
let _ = tray.set_visible(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tray.set_visible(true) on line 835 executes immediately, even when the spawned task finds an active recording and stops it. The tray visibility should probably be set only after confirming no recording is active.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src-tauri/src/tray.rs
Line: 827-835

Comment:
`tray.set_visible(true)` on line 835 executes immediately, even when the spawned task finds an active recording and stops it. The tray visibility should probably be set only after confirming no recording is active.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +156 to +163
let in_local_bounds = mouse_position.x >= local_x_min
&& mouse_position.x <= local_x_max
&& mouse_position.y >= local_y_min
&& mouse_position.y <= local_y_max;
let in_global_bounds = mouse_position.x >= global_x_min
&& mouse_position.x <= global_x_max
&& mouse_position.y >= global_y_min
&& mouse_position.y <= global_y_max;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verify whether cursor_position() returns window-relative or global coordinates on Linux - if it's consistently one or the other, the in_local_bounds || in_global_bounds dual check may be unnecessary

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src-tauri/src/fake_window.rs
Line: 156-163

Comment:
Verify whether `cursor_position()` returns window-relative or global coordinates on Linux - if it's consistently one or the other, the `in_local_bounds || in_global_bounds` dual check may be unnecessary

How can I resolve this? If you propose a fix, please make it concise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants