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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ Rsnap requires **Screen Recording** permission to capture other apps/windows.
- `Filename Prefix` (default: `Rsnap`, sanitized to `[A-Za-z0-9_-]`)
- `Naming` (`Timestamp` or `Sequence`)
- `Frame Preset` (`Off`, wallpaper, or gradient backgrounds)
- `Apply To` for drag-region and window captures; fullscreen captures are excluded
- `Apply To` for drag-region and window captures; scroll capture follows drag-region, and
fullscreen captures are excluded

### Current scroll-capture status

Expand Down
4 changes: 2 additions & 2 deletions docs/spec/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ Defines:
the current wallpaper path and present pixels, but bounded wallpaper thumbnail decoding and caching
are Rust-owned.
- Apply To must be disabled while Frame Preset is Off.
- Capture frame effects may apply to drag-region captures, window captures, or both. Fullscreen
captures are excluded from this setting.
- Capture frame effects may apply to drag-region captures, window captures, or both. Scroll capture
follows drag-region applicability, and fullscreen captures are excluded from this setting.

## Permission Settings

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ extension CaptureSessionController {
}

if let scrollExport = try activeScrollCaptureExportImage() {
let result =
applyingCaptureFrameEffect
? applyCaptureFrameEffectIfNeeded(
to: scrollExport,
selection: selection,
hasOverlayEdits: false
)
: scrollExport
NativeHostTelemetry.frozenSelectionImageTiming(
captureID: currentCaptureTelemetryID,
totalMilliseconds: NativeHostTelemetry.milliseconds(since: captureStartedAt),
Expand All @@ -168,11 +176,11 @@ extension CaptureSessionController {
compositeMilliseconds: 0,
source: "scroll_capture_export",
success: true,
width: scrollExport.width,
height: scrollExport.height,
width: result.width,
height: result.height,
hasOverlayEdits: false
)
return scrollExport
return result
}

let snapshotMatchedBefore = chromeState.frozenSelectionSnapshot == selection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ struct NativeHostSettings: Equatable {
copy.hudTintHue = copy.hudTintHue.clamped(to: 0...1)
copy.hudTintSaturation = copy.hudTintSaturation.clamped(to: 0...1)
copy.hudTintBrightness = copy.hudTintBrightness.clamped(to: 0...1)
copy.captureFrameApplicability = copy.captureFrameApplicability.normalizedForStorage
return copy
}

Expand Down Expand Up @@ -431,26 +432,46 @@ package enum CaptureFrameBackgroundPreference: String, CaseIterable {
enum CaptureFrameApplicabilityPreference: String, CaseIterable {
case dragRegion = "drag_region"
case window
case scrollCapture = "scroll_capture"
case all
case both

static let allCases: [Self] = [.dragRegion, .window, .all]

var title: String {
switch self {
case .dragRegion:
return "Drag"
case .window:
return "Window"
case .both:
case .scrollCapture:
return "Scroll"
case .all, .both:
return "Both"
}
}

var normalizedForStorage: Self {
switch self {
case .scrollCapture:
return .dragRegion
case .both:
return .all
case .dragRegion, .window, .all:
return self
}
}

func includes(_ source: CaptureFrameSource) -> Bool {
switch (self, source) {
case (.dragRegion, .dragRegion), (.window, .window), (.both, .dragRegion),
(.both, .window):
case (.dragRegion, .dragRegion), (.dragRegion, .scrollCapture),
(.window, .window), (.scrollCapture, .scrollCapture), (.all, .dragRegion),
(.all, .window), (.all, .scrollCapture), (.both, .dragRegion),
(.both, .window), (.both, .scrollCapture):
return true
case (.dragRegion, .window), (.window, .dragRegion), (_, .fullScreen),
(_, .scrollCapture), (_, .unknown):
case (.dragRegion, .window), (.window, .dragRegion), (.window, .scrollCapture),
(.scrollCapture, .dragRegion), (.scrollCapture, .window), (_, .fullScreen),
(_, .unknown):
return false
}
}
Expand Down