WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
25 changes: 24 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,30 @@
"Bash(cargo check:*)",
"Bash(cargo fmt:*)",
"Bash(pnpm format:*)",
"Bash(pnpm exec biome check:*)"
"Bash(pnpm exec biome check:*)",
"Bash(grep:*)",
"Bash(cargo metadata:*)",
"Bash(ffprobe:*)",
"Bash(ls:*)",
"Bash(find:*)",
"Bash(cat:*)",
"WebFetch(domain:raw.githubusercontent.com)",
"WebFetch(domain:api.github.com)",
"Bash(cargo doc:*)",
"Bash(cargo clippy:*)",
"Bash(python3:*)",
"Bash(cargo run:*)",
"WebSearch",
"Bash(xargs ls:*)",
"WebFetch(domain:ffmpeg.org)",
"Bash(git log:*)",
"Bash(tree:*)",
"Bash(tail:*)",
"Bash(pnpm typecheck:desktop:*)",
"Bash(pnpm exec tsc:*)",
"Bash(pnpm biome check:*)",
"Bash(pnpm --dir apps/desktop exec tsc:*)",
"Bash(xxd:*)"
],
"deny": [],
"ask": []
Expand Down
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ specta = { version = "=2.0.0-rc.20", features = [
"chrono"
] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"

nokhwa = { git = "https://github.com/CapSoftware/nokhwa", rev = "b9c8079e82e2", features = [
"input-native",
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/src-tauri/src/general_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ pub struct GeneralSettingsStore {
pub instant_mode_max_resolution: u32,
#[serde(default)]
pub default_project_name_template: Option<String>,
#[serde(default)]
pub crash_recovery_recording: bool,
}

fn default_enable_native_camera_preview() -> bool {
Expand Down Expand Up @@ -190,6 +192,7 @@ impl Default for GeneralSettingsStore {
delete_instant_recordings_after_upload: false,
instant_mode_max_resolution: 1920,
default_project_name_template: None,
crash_recovery_recording: false,
}
}
}
Expand Down
11 changes: 10 additions & 1 deletion apps/desktop/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ mod posthog;
mod presets;
mod recording;
mod recording_settings;
mod recovery;
mod screenshot_editor;
mod target_select_overlay;
mod thumbnails;
Expand Down Expand Up @@ -2164,7 +2165,7 @@ async fn editor_delete_project(
#[specta::specta]
#[instrument(skip(app))]
async fn show_window(app: AppHandle, window: ShowCapWindow) -> Result<(), String> {
let _ = window.show(&app).await;
window.show(&app).await.map_err(|e| e.to_string())?;
Ok(())
}

Expand Down Expand Up @@ -2403,6 +2404,9 @@ pub async fn run(recording_logging_handle: LoggingHandle, logs_dir: PathBuf) {
target_select_overlay::focus_window,
editor_delete_project,
format_project_name,
recovery::find_incomplete_recordings,
recovery::recover_recording,
recovery::discard_incomplete_recording,
])
.events(tauri_specta::collect_events![
RecordingOptionsChanged,
Expand Down Expand Up @@ -3122,6 +3126,11 @@ async fn create_editor_instance_impl(
RenderFrameEvent::listen_any(&app, {
let preview_tx = instance.preview_tx.clone();
move |e| {
tracing::debug!(
frame = e.payload.frame_number,
fps = e.payload.fps,
"RenderFrameEvent received"
);
preview_tx.send_modify(|v| {
*v = Some((
e.payload.frame_number,
Expand Down
5 changes: 4 additions & 1 deletion apps/desktop/src-tauri/src/platform/macos/delegates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ pub fn setup<R: Runtime>(window: Window<R>, controls_inset: LogicalPosition<f64>
use objc::runtime::{Object, Sel};
use std::ffi::c_void;

let ns_win = window.ns_window().expect("Failed to create window handle");
let Ok(ns_win) = window.ns_window() else {
tracing::warn!("Failed to get window handle for delegate setup");
return;
};

// Do the initial positioning
position_window_controls(UnsafeWindowHandle(ns_win), &controls_inset);
Expand Down
8 changes: 4 additions & 4 deletions apps/desktop/src-tauri/src/platform/macos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ pub use sc_shareable_content::*;
pub fn set_window_level(window: tauri::Window, level: objc2_app_kit::NSWindowLevel) {
let c_window = window.clone();
_ = window.run_on_main_thread(move || unsafe {
let ns_win = c_window
.ns_window()
.expect("Failed to get native window handle")
as *const objc2_app_kit::NSWindow;
let Ok(ns_win) = c_window.ns_window() else {
return;
};
let ns_win = ns_win as *const objc2_app_kit::NSWindow;
(*ns_win).setLevel(level);
});
}
Expand Down
Loading
Loading