Skip to content

Commit f54957f

Browse files
Merge pull request #1686 from CapSoftware/0.4.8-fixes
Cursor and zoom polish, playback prefetch fixes, and platform onboarding tweaks
2 parents 5dd73f0 + b2f7d39 commit f54957f

27 files changed

Lines changed: 636 additions & 340 deletions

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/desktop/src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cap-desktop"
3-
version = "0.4.8"
3+
version = "0.4.81"
44
description = "Beautiful screen recordings, owned by you."
55
authors = ["you"]
66
edition = "2024"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ impl Default for GeneralSettingsStore {
217217
server_url: default_server_url(),
218218
recording_countdown: Some(3),
219219
enable_native_camera_preview: default_enable_native_camera_preview(),
220-
auto_zoom_on_clicks: true,
220+
auto_zoom_on_clicks: false,
221221
capture_keyboard_events: true,
222222
post_deletion_behaviour: PostDeletionBehaviour::DoNothing,
223223
excluded_windows: default_excluded_windows(),

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3350,6 +3350,7 @@ pub async fn run(recording_logging_handle: LoggingHandle, logs_dir: PathBuf) {
33503350
.with_denylist(&[
33513351
CapWindowId::Onboarding.label().as_str(),
33523352
CapWindowId::Main.label().as_str(),
3353+
CapWindowId::Settings.label().as_str(),
33533354
"window-capture-occluder",
33543355
"target-select-overlay",
33553356
CapWindowId::CaptureArea.label().as_str(),

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub enum OSPermission {
4545

4646
#[tauri::command(async)]
4747
#[specta::specta]
48-
pub fn open_permission_settings(app: tauri::AppHandle, _permission: OSPermission) {
48+
pub fn open_permission_settings(_app: tauri::AppHandle, _permission: OSPermission) {
4949
#[cfg(target_os = "macos")]
5050
{
5151
match _permission {
@@ -77,7 +77,7 @@ pub fn open_permission_settings(app: tauri::AppHandle, _permission: OSPermission
7777

7878
match process {
7979
Ok(mut process) => {
80-
let app = app.clone();
80+
let app = _app.clone();
8181
tokio::spawn(async move {
8282
match tokio::task::spawn_blocking(move || process.wait()).await {
8383
Ok(Err(err)) => {

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

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ use std::{
1414
time::Duration,
1515
};
1616
use tauri::{
17-
AppHandle, LogicalPosition, Manager, Monitor, PhysicalPosition, PhysicalSize, WebviewUrl,
18-
WebviewWindow, WebviewWindowBuilder, Wry,
17+
AppHandle, LogicalPosition, LogicalSize, Manager, Monitor, PhysicalPosition, PhysicalSize,
18+
WebviewUrl, WebviewWindow, WebviewWindowBuilder, Wry,
1919
};
2020
use tauri_specta::Event;
2121
use tokio::sync::RwLock;
@@ -377,6 +377,19 @@ fn is_position_on_any_screen(pos_x: f64, pos_y: f64) -> bool {
377377
false
378378
}
379379

380+
fn ensure_settings_window_bounds(window: &WebviewWindow) {
381+
const MIN_W: f64 = 800.0;
382+
const MIN_H: f64 = 580.0;
383+
let _ = window.set_min_size(Some(LogicalSize::new(MIN_W, MIN_H)));
384+
if let (Ok(physical), Ok(scale)) = (window.inner_size(), window.scale_factor()) {
385+
let width = physical.width as f64 / scale;
386+
let height = physical.height as f64 / scale;
387+
if width < MIN_W || height < MIN_H {
388+
let _ = window.set_size(LogicalSize::new(width.max(MIN_W), height.max(MIN_H)));
389+
}
390+
}
391+
}
392+
380393
#[derive(Clone, Deserialize, Type)]
381394
pub enum CapWindowId {
382395
Main,
@@ -955,6 +968,10 @@ impl ShowCapWindow {
955968
window.unminimize().ok();
956969
window.set_focus().ok();
957970

971+
if let Self::Settings { .. } = self {
972+
ensure_settings_window_bounds(&window);
973+
}
974+
958975
if let Self::Main { init_target_mode } = self {
959976
let _ = RequestSetTargetMode {
960977
target_mode: *init_target_mode,
@@ -1262,7 +1279,6 @@ impl ShowCapWindow {
12621279

12631280
#[cfg(windows)]
12641281
{
1265-
use tauri::LogicalSize;
12661282
if let Err(e) = window.set_size(LogicalSize::new(800.0, 580.0)) {
12671283
warn!("Failed to set Settings window size on Windows: {}", e);
12681284
}
@@ -1273,6 +1289,7 @@ impl ShowCapWindow {
12731289

12741290
window.show().ok();
12751291
window.set_focus().ok();
1292+
ensure_settings_window_bounds(&window);
12761293

12771294
window
12781295
}

apps/desktop/src/routes/(window-chrome)/new-main/index.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
} from "@tauri-apps/api/webviewWindow";
1515
import { getCurrentWindow, LogicalSize } from "@tauri-apps/api/window";
1616
import * as dialog from "@tauri-apps/plugin-dialog";
17-
import { type as ostype } from "@tauri-apps/plugin-os";
1817
import * as shell from "@tauri-apps/plugin-shell";
1918
import * as updater from "@tauri-apps/plugin-updater";
2019
import { cx } from "cva";
@@ -1705,9 +1704,7 @@ function Page() {
17051704
class="flex flex-1 gap-1 items-center mx-2 min-w-0"
17061705
data-tauri-drag-region
17071706
>
1708-
<Show when={ostype() === "macos"}>
1709-
<MainWindowHelpButton />
1710-
</Show>
1707+
<MainWindowHelpButton />
17111708
<div class="flex-1 min-h-9 min-w-0" data-tauri-drag-region />
17121709
<div class="flex gap-1 items-center shrink-0" data-tauri-drag-region>
17131710
<Tooltip content={<span>Settings</span>}>
@@ -1773,9 +1770,6 @@ function Page() {
17731770
</button>
17741771
)}
17751772
</div>
1776-
<Show when={ostype() !== "macos"}>
1777-
<MainWindowHelpButton />
1778-
</Show>
17791773
</div>
17801774
</WindowChromeHeader>
17811775
<Show when={!activeMenu()}>

apps/desktop/src/routes/(window-chrome)/onboarding.tsx

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,17 @@ export default function OnboardingPage() {
323323
});
324324

325325
const isMacOS = createMemo(() => ostype() === "macos");
326-
const permissionsOnly = createMemo(() => isRevisit() && permissionsNeeded());
326+
const permissionsOnly = createMemo(
327+
() => isMacOS() && isRevisit() && permissionsNeeded(),
328+
);
329+
330+
createEffect(() => {
331+
ready();
332+
if (!isMacOS()) {
333+
setPermsGranted(true);
334+
setCorePermsGranted(true);
335+
}
336+
});
327337

328338
const totalSteps = createMemo(() => {
329339
if (permissionsOnly()) return 1;
@@ -362,11 +372,11 @@ export default function OnboardingPage() {
362372
setIsExiting(true);
363373
await generalSettingsStore.set({ hasCompletedStartup: true });
364374
setTimeout(() => {
365-
setShowStartupOverlay(false);
366-
setIsExiting(false);
367375
if (!isMacOS()) {
368376
goToStep(1);
369377
}
378+
setShowStartupOverlay(false);
379+
setIsExiting(false);
370380
}, 600);
371381
};
372382

@@ -403,7 +413,7 @@ export default function OnboardingPage() {
403413
return "Continue";
404414
};
405415

406-
const nextDisabled = () => step() === 0 && !permsGranted();
416+
const nextDisabled = () => isMacOS() && step() === 0 && !permsGranted();
407417

408418
const handleSkipOnboarding = () => {
409419
if (!corePermsGranted() || permissionsOnly()) return;
@@ -477,13 +487,15 @@ export default function OnboardingPage() {
477487
<div class="flex flex-col flex-1 min-h-0 overflow-hidden relative">
478488
<OnboardingAmbientBackdrop />
479489
<div class="relative flex-1 min-h-0 z-10">
480-
<StepPanel active={step() === 0} index={0} currentStep={step()}>
481-
<PermissionsStep
482-
active={step() === 0 && !showStartupOverlay()}
483-
onPermissionsChanged={setPermsGranted}
484-
onCorePermissionsChanged={setCorePermsGranted}
485-
/>
486-
</StepPanel>
490+
<Show when={isMacOS()}>
491+
<StepPanel active={step() === 0} index={0} currentStep={step()}>
492+
<PermissionsStep
493+
active={step() === 0 && !showStartupOverlay()}
494+
onPermissionsChanged={setPermsGranted}
495+
onCorePermissionsChanged={setCorePermsGranted}
496+
/>
497+
</StepPanel>
498+
</Show>
487499
<Show when={!permissionsOnly()}>
488500
<StepPanel active={step() === 1} index={1} currentStep={step()}>
489501
<ModesOverviewStep active={step() === 1} />

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ type CursorPresetValues = {
220220
friction: number;
221221
};
222222

223-
const DEFAULT_CURSOR_MOTION_BLUR = 1.0;
223+
const DEFAULT_CURSOR_MOTION_BLUR = 0.3;
224224

225225
const CURSOR_TYPE_OPTIONS = [
226226
{
@@ -242,12 +242,24 @@ const CURSOR_ANIMATION_STYLE_OPTIONS = [
242242
description: "Relaxed easing with a gentle follow and higher inertia.",
243243
preset: { tension: 65, mass: 1.8, friction: 16 },
244244
},
245+
{
246+
value: "smooth",
247+
label: "Smooth",
248+
description: "Ultra-smooth cinematic feel with high damping.",
249+
preset: { tension: 80, mass: 2.5, friction: 28 },
250+
},
245251
{
246252
value: "mellow",
247253
label: "Mellow",
248254
description: "Balanced smoothing for everyday tutorials and walkthroughs.",
249255
preset: { tension: 120, mass: 1.1, friction: 18 },
250256
},
257+
{
258+
value: "fast",
259+
label: "Fast",
260+
description: "Quick, responsive smoothing for fast-paced content.",
261+
preset: { tension: 380, mass: 1.0, friction: 30 },
262+
},
251263
{
252264
value: "custom",
253265
label: "Custom",

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

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
createResource,
1515
createSignal,
1616
ErrorBoundary,
17+
For,
1718
Match,
1819
on,
1920
onCleanup,
@@ -54,9 +55,11 @@ import { Dialog, DialogContent, EditorButton, Input, Subfield } from "./ui";
5455
const DEFAULT_TIMELINE_HEIGHT = 260;
5556
const MIN_PLAYER_CONTENT_HEIGHT = 320;
5657
const MIN_TIMELINE_HEIGHT = 240;
57-
const RESIZE_HANDLE_HEIGHT = 8;
58+
const RESIZE_HANDLE_HEIGHT = 16;
5859
const MIN_PLAYER_HEIGHT = MIN_PLAYER_CONTENT_HEIGHT + RESIZE_HANDLE_HEIGHT;
5960

61+
const TIMELINE_RESIZE_GRIP_MARKS = [0, 1, 2] as const;
62+
6063
function getEditorErrorMessage(error: unknown) {
6164
return error instanceof Error ? error.message : String(error);
6265
}
@@ -462,18 +465,27 @@ function Inner() {
462465
<div
463466
role="separator"
464467
aria-orientation="horizontal"
465-
class="flex-none transition-colors hover:bg-gray-3/30"
468+
class="flex-none shrink-0 border-t border-gray-4 dark:border-gray-5 bg-gray-2/95 dark:bg-gray-3/55 transition-colors hover:bg-gray-3/70 dark:hover:bg-gray-4/55"
466469
style={{ height: `${RESIZE_HANDLE_HEIGHT}px` }}
467470
>
468471
<div
469-
class="flex justify-center items-center h-full cursor-row-resize select-none group"
470-
classList={{ "bg-gray-3/50": isResizingTimeline() }}
472+
class="flex flex-col gap-0.5 justify-center items-center h-full w-full cursor-row-resize select-none group"
473+
classList={{
474+
"bg-gray-3/55 dark:bg-gray-4/50": isResizingTimeline(),
475+
}}
471476
onMouseDown={handleTimelineResizeStart}
477+
aria-label="Resize timeline height"
472478
>
473-
<div
474-
class="h-1 w-12 rounded-full bg-gray-4 transition-colors group-hover:bg-gray-6"
475-
classList={{ "bg-gray-7": isResizingTimeline() }}
476-
/>
479+
<For each={TIMELINE_RESIZE_GRIP_MARKS}>
480+
{() => (
481+
<div
482+
class="h-0.5 w-20 max-w-[85%] rounded-full bg-gray-6 dark:bg-gray-7 shadow-[0_1px_0_rgb(0_0_0_/0.06)] transition-colors group-hover:bg-gray-9 dark:group-hover:bg-gray-11"
483+
classList={{
484+
"bg-gray-9 dark:bg-gray-11": isResizingTimeline(),
485+
}}
486+
/>
487+
)}
488+
</For>
477489
</div>
478490
</div>
479491
</div>

0 commit comments

Comments
 (0)