Skip to content

Commit 816cd3c

Browse files
Merge pull request #1481 from CapSoftware/feedback-bits
tired
2 parents 0103006 + b4e7d04 commit 816cd3c

File tree

15 files changed

+90
-56
lines changed

15 files changed

+90
-56
lines changed

apps/desktop/src-tauri/src/lib.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2931,9 +2931,19 @@ pub async fn run(recording_logging_handle: LoggingHandle, logs_dir: PathBuf) {
29312931

29322932
match event {
29332933
WindowEvent::CloseRequested { .. } => {
2934-
if let Ok(CapWindowId::Camera) = CapWindowId::from_str(label) {
2935-
tracing::warn!("Camera window CloseRequested event received!");
2936-
tokio::spawn(cleanup_camera_window(app.clone()));
2934+
if let Ok(window_id) = CapWindowId::from_str(label) {
2935+
match window_id {
2936+
CapWindowId::Camera => {
2937+
tracing::warn!("Camera window CloseRequested event received!");
2938+
tokio::spawn(cleanup_camera_window(app.clone()));
2939+
}
2940+
CapWindowId::Main => {
2941+
if let Some(camera_window) = CapWindowId::Camera.get(app) {
2942+
let _ = camera_window.close();
2943+
}
2944+
}
2945+
_ => {}
2946+
}
29372947
}
29382948
}
29392949
WindowEvent::Destroyed => {

apps/desktop/src-tauri/src/tray.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,14 @@ fn handle_previous_item_click(app: &AppHandle, path_str: &str) {
527527
}
528528
}
529529

530+
pub fn get_tray_icon() -> &'static [u8] {
531+
include_bytes!("../icons/tray-default-icon.png")
532+
}
533+
530534
pub fn get_mode_icon(mode: RecordingMode) -> &'static [u8] {
535+
if cfg!(target_os = "windows") {
536+
return get_tray_icon();
537+
}
531538
match mode {
532539
RecordingMode::Studio => include_bytes!("../icons/tray-default-icon-studio.png"),
533540
RecordingMode::Instant => include_bytes!("../icons/tray-default-icon-instant.png"),
@@ -536,6 +543,10 @@ pub fn get_mode_icon(mode: RecordingMode) -> &'static [u8] {
536543
}
537544

538545
pub fn update_tray_icon_for_mode(app: &AppHandle, mode: RecordingMode) {
546+
if cfg!(target_os = "windows") {
547+
return;
548+
}
549+
539550
let Some(tray) = app.tray_by_id("tray") else {
540551
return;
541552
};
@@ -734,6 +745,11 @@ pub fn create_tray(app: &AppHandle) -> tauri::Result<()> {
734745
let is_recording = is_recording.clone();
735746
move |_| {
736747
is_recording.store(true, Ordering::Relaxed);
748+
749+
if cfg!(target_os = "windows") {
750+
return;
751+
}
752+
737753
let Some(tray) = app.tray_by_id("tray") else {
738754
return;
739755
};
@@ -749,6 +765,11 @@ pub fn create_tray(app: &AppHandle) -> tauri::Result<()> {
749765
let is_recording = is_recording.clone();
750766
move |_| {
751767
is_recording.store(false, Ordering::Relaxed);
768+
769+
if cfg!(target_os = "windows") {
770+
return;
771+
}
772+
752773
let Some(tray) = app_handle.tray_by_id("tray") else {
753774
return;
754775
};

apps/desktop/src/routes/editor/Editor.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,18 @@ function Inner() {
206206
}),
207207
);
208208

209-
const updateConfigAndRender = throttle(async (time: number) => {
209+
const doConfigUpdate = async (time: number) => {
210210
const config = serializeProjectConfiguration(project);
211211
await commands.updateProjectConfigInMemory(config);
212212
canvasControls()?.resetFrameState();
213213
renderFrame(time);
214-
}, 1000 / FPS);
214+
};
215+
const throttledConfigUpdate = throttle(doConfigUpdate, 1000 / FPS);
216+
const trailingConfigUpdate = debounce(doConfigUpdate, 1000 / FPS + 16);
217+
const updateConfigAndRender = (time: number) => {
218+
throttledConfigUpdate(time);
219+
trailingConfigUpdate(time);
220+
};
215221
createEffect(
216222
on(
217223
() => trackDeep(project),

apps/desktop/src/routes/editor/PresetsDropdown.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export function PresetsDropdown() {
5050
const normalizedConfig = normalizeProject({
5151
...preset.config,
5252
timeline: project.timeline,
53+
clips: project.clips,
5354
});
5455
setProject(reconcile(normalizedConfig));
5556
}

apps/desktop/src/routes/screenshot-editor/context.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createContextProvider } from "@solid-primitives/context";
22
import { trackStore } from "@solid-primitives/deep";
3-
import { debounce } from "@solid-primitives/scheduled";
3+
import { debounce, throttle } from "@solid-primitives/scheduled";
44
import { makePersisted } from "@solid-primitives/storage";
55
import { convertFileSrc } from "@tauri-apps/api/core";
66
import {
@@ -293,6 +293,16 @@ function createScreenshotEditorContext() {
293293
}
294294
});
295295

296+
const FPS = 60;
297+
const FRAME_TIME = 1000 / FPS;
298+
299+
const doRenderUpdate = (config: ProjectConfiguration) => {
300+
commands.updateScreenshotConfig(config, false);
301+
};
302+
303+
const throttledRenderUpdate = throttle(doRenderUpdate, FRAME_TIME);
304+
const trailingRenderUpdate = debounce(doRenderUpdate, FRAME_TIME + 16);
305+
296306
const saveConfig = debounce((config: ProjectConfiguration) => {
297307
commands.updateScreenshotConfig(config, true);
298308
}, 1000);
@@ -312,7 +322,8 @@ function createScreenshotEditorContext() {
312322
annotations: unwrap(annotations),
313323
};
314324

315-
commands.updateScreenshotConfig(config, false);
325+
throttledRenderUpdate(config);
326+
trailingRenderUpdate(config);
316327
saveConfig(config);
317328
},
318329
),

apps/desktop/src/utils/tauri.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ uploadProgressEvent: "upload-progress-event"
369369

370370
/** user-defined types **/
371371

372-
export type AllGpusInfo = { gpus: GpuInfoDiag[]; primaryGpuIndex: number | null; isMultiGpuSystem: boolean; hasDiscreteGpu: boolean }
373372
export type Annotation = { id: string; type: AnnotationType; x: number; y: number; width: number; height: number; strokeColor: string; strokeWidth: number; fillColor: string; opacity: number; rotation: number; text: string | null; maskType?: MaskType | null; maskLevel?: number | null }
374373
export type AnnotationType = "arrow" | "circle" | "rectangle" | "text" | "mask"
375374
export type AppTheme = "system" | "light" | "dark"
@@ -438,7 +437,6 @@ quality: number | null;
438437
* Whether to prioritize speed over quality (default: false)
439438
*/
440439
fast: boolean | null }
441-
export type GpuInfoDiag = { vendor: string; description: string; dedicatedVideoMemoryMb: number; adapterIndex: number; isSoftwareAdapter: boolean; isBasicRenderDriver: boolean; supportsHardwareEncoding: boolean }
442440
export type HapticPattern = "alignment" | "levelChange" | "generic"
443441
export type HapticPerformanceTime = "default" | "now" | "drawCompleted"
444442
export type Hotkey = { code: string; meta: boolean; ctrl: boolean; alt: boolean; shift: boolean }
@@ -451,6 +449,7 @@ export type JsonValue<T> = [T]
451449
export type LogicalBounds = { position: LogicalPosition; size: LogicalSize }
452450
export type LogicalPosition = { x: number; y: number }
453451
export type LogicalSize = { width: number; height: number }
452+
export type MacOSVersionInfo = { displayName: string }
454453
export type MainWindowRecordingStartBehaviour = "close" | "minimise"
455454
export type MaskKeyframes = { position?: MaskVectorKeyframe[]; size?: MaskVectorKeyframe[]; intensity?: MaskScalarKeyframe[] }
456455
export type MaskKind = "sensitive" | "highlight"
@@ -493,7 +492,6 @@ export type RecordingStatus = "pending" | "recording"
493492
export type RecordingStopped = null
494493
export type RecordingTargetMode = "display" | "window" | "area"
495494
export type RenderFrameEvent = { frame_number: number; fps: number; resolution_base: XY<number> }
496-
export type RenderingStatus = { isUsingSoftwareRendering: boolean; isUsingBasicRenderDriver: boolean; hardwareEncodingAvailable: boolean; warningMessage: string | null }
497495
export type RequestOpenRecordingPicker = { target_mode: RecordingTargetMode | null }
498496
export type RequestOpenSettings = { page: string }
499497
export type RequestScreenCapturePrewarm = { force?: boolean }
@@ -514,7 +512,7 @@ export type StartRecordingInputs = { capture_target: ScreenCaptureTarget; captur
514512
export type StereoMode = "stereo" | "monoL" | "monoR"
515513
export type StudioRecordingMeta = { segment: SingleSegment } | { inner: MultipleSegments }
516514
export type StudioRecordingStatus = { status: "InProgress" } | { status: "NeedsRemux" } | { status: "Failed"; error: string } | { status: "Complete" }
517-
export type SystemDiagnostics = { windowsVersion: WindowsVersionInfo | null; gpuInfo: GpuInfoDiag | null; allGpus: AllGpusInfo | null; renderingStatus: RenderingStatus; availableEncoders: string[]; graphicsCaptureSupported: boolean; d3D11VideoProcessorAvailable: boolean }
515+
export type SystemDiagnostics = { macosVersion: MacOSVersionInfo | null; availableEncoders: string[]; screenCaptureSupported: boolean }
518516
export type TargetUnderCursor = { display_id: DisplayId | null; window: WindowUnderCursor | null }
519517
export type TextSegment = { start: number; end: number; enabled?: boolean; content?: string; center?: XY<number>; size?: XY<number>; fontFamily?: string; fontSize?: number; fontWeight?: number; italic?: boolean; color?: string; fadeDuration?: number }
520518
export type TimelineConfiguration = { segments: TimelineSegment[]; zoomSegments: ZoomSegment[]; sceneSegments?: SceneSegment[]; maskSegments?: MaskSegment[]; textSegments?: TextSegment[] }
@@ -531,7 +529,6 @@ export type VideoUploadInfo = { id: string; link: string; config: S3UploadMeta }
531529
export type WindowExclusion = { bundleIdentifier?: string | null; ownerName?: string | null; windowTitle?: string | null }
532530
export type WindowId = string
533531
export type WindowUnderCursor = { id: WindowId; app_name: string; bounds: LogicalBounds }
534-
export type WindowsVersionInfo = { major: number; minor: number; build: number; displayName: string; meetsRequirements: boolean; isWindows11: boolean }
535532
export type XY<T> = { x: T; y: T }
536533
export type ZoomMode = "auto" | { manual: { x: number; y: number } }
537534
export type ZoomSegment = { start: number; end: number; amount: number; mode: ZoomMode }

apps/web/content/changelog/76.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Editor playback stability & bug fixes
33
app: Cap Desktop
4-
publishedAt: 2025-10-19
4+
publishedAt: "2025-10-19"
55
version: 0.3.75
66
image:
77
---

apps/web/content/changelog/77.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Video upload improvements
33
app: Cap Desktop
4-
publishedAt: 2025-10-21
4+
publishedAt: "2025-10-21"
55
version: 0.3.76
66
image:
77
---

apps/web/content/changelog/78.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Instant Mode resolution picker + Improvements to audio and uploader
33
app: Cap Desktop
4-
publishedAt: 2025-10-23
4+
publishedAt: "2025-10-23"
55
version: 0.3.77
66
image:
77
---

apps/web/content/changelog/79.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Recording fixes + Editor enhancements
33
app: Cap Desktop
4-
publishedAt: 2025-10-23
4+
publishedAt: "2025-10-23"
55
version: 0.3.78
66
image:
77
---

0 commit comments

Comments
 (0)