Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ ashpd = "0.7"
[features]
default = ["custom-protocol"]
custom-protocol = ["tauri/custom-protocol"]

[lints.rust]
# The `objc` crate's msg_send! macro expands to a `cfg(cargo-clippy)` check;
# declare it as a known cfg so it doesn't trip the unexpected_cfgs lint.
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(cargo-clippy)'] }
14 changes: 11 additions & 3 deletions src-tauri/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ use tauri::{Emitter, Manager};

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
// include_audio/system_audio are part of the frontend wire contract but only
// used by the recording path, not by still capture — keep them, don't warn.
#[allow(dead_code)]
pub struct CaptureOptions {
pub format: Option<String>,
pub quality: Option<f32>,
Expand Down Expand Up @@ -35,6 +38,9 @@ pub struct Rectangle {

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
// video_bitrate/audio_bitrate are accepted from the frontend but not yet
// threaded into the encoder — reserved config, keep without warning.
#[allow(dead_code)]
pub struct RecordOptions {
pub format: Option<String>,
pub video_bitrate: Option<u32>,
Expand Down Expand Up @@ -82,8 +88,8 @@ pub fn capture_screen_fast(display_id: Option<i32>, fps: u32, bounds: Option<Rec
// Determine capture region (full screen or bounded region)
let (region_x, region_y, width, height) = if let Some(rect) = bounds {
// Scale logical bounds to physical pixels for HiDPI displays
let x = ((rect.x as f64 * scale_x).max(0.0) as u32);
let y = ((rect.y as f64 * scale_y).max(0.0) as u32);
let x = (rect.x as f64 * scale_x).max(0.0) as u32;
let y = (rect.y as f64 * scale_y).max(0.0) as u32;
let w = ((rect.width as f64 * scale_x) as u32).min(full_width - x);
let h = ((rect.height as f64 * scale_y) as u32).min(full_height - y);
println!("[Capture] Logical bounds: ({}, {}) {}x{} → Physical: ({}, {}) {}x{}",
Expand Down Expand Up @@ -160,7 +166,9 @@ pub fn capture_screen_fast(display_id: Option<i32>, fps: u32, bounds: Option<Rec
return Err("Platform not supported".to_string());
}

// Internal helper for recording (not exposed as command)
// Internal helper for recording (not exposed as command).
// Kept as a reference PNG-capture path; recording uses capture_screen_fast.
#[allow(dead_code)]
pub fn capture_screen_internal(display_id: Option<i32>) -> Result<Vec<u8>, String> {
#[cfg(target_os = "macos")]
{
Expand Down
9 changes: 0 additions & 9 deletions src-tauri/src/overlay.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
// src-tauri/src/overlay.rs
use tauri::{AppHandle, Emitter, LogicalPosition, LogicalSize, Manager, WebviewUrl, WebviewWindowBuilder};
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Rectangle {
pub x: i32,
pub y: i32,
pub width: u32,
pub height: u32,
}

/// Pre-create the region-selector overlay window, hidden, at app startup.
///
Expand Down
4 changes: 3 additions & 1 deletion src-tauri/src/recording.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::time::{Duration, Instant};
use std::process::Command;
use std::fs::{self, File};
use std::io::Write;
use std::path::PathBuf;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand All @@ -29,6 +28,9 @@ pub struct RecordingHandle {
pub format: Option<String>,
}

// Several fields snapshot the request for diagnostics/future use; the live
// recording thread reads the Arc-shared ones. Keep them without warning.
#[allow(dead_code)]
struct RecordingState {
handle: RecordingHandle,
fps: u32,
Expand Down