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 .changeset/26563231.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: patch
---

Refresh tile previews on every overlay show so live updates aren't masked by the previous capture
15 changes: 6 additions & 9 deletions Sources/cmdcmd/Overlay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -492,15 +492,12 @@ private static func windowMostlyOn(displayBounds: CGRect, window: SCWindow) -> B
updateSelection()
}
let live = config.livePreviewsEnabled
let delay: TimeInterval = config.animations ? Self.pickDuration + 0.05 : 0
DispatchQueue.main.asyncAfter(deadline: .now() + delay) { [ordered] in
Task {
await withTaskGroup(of: Void.self) { group in
for t in ordered {
group.addTask {
await t.snapshot()
if live { await t.start() }
}
Task {
await withTaskGroup(of: Void.self) { group in
for t in ordered {
group.addTask {
await t.snapshot()
if live { await t.start() }
}
}
}
Expand Down
6 changes: 2 additions & 4 deletions Sources/cmdcmd/Tile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ final class Tile: NSObject, SCStreamOutput, SCStreamDelegate {
CATransaction.setDisableActions(true)
inner.contents = cached
CATransaction.commit()
self.hasRenderedFrame = true
}
}

Expand Down Expand Up @@ -320,7 +319,7 @@ final class Tile: NSObject, SCStreamOutput, SCStreamDelegate {
}

func snapshot() async {
if cancelled || hasRenderedFrame || hasRenderedLiveFrame { return }
if cancelled || hasRenderedLiveFrame { return }
let filter = SCContentFilter(desktopIndependentWindow: scWindow)
let config = captureConfig(maxDim: Tile.thumbMaxDim)
do {
Expand All @@ -334,6 +333,7 @@ final class Tile: NSObject, SCStreamOutput, SCStreamDelegate {
self.content.contents = image
CATransaction.commit()
self.hasRenderedFrame = true
self.lastSignificantChangeAt = CFAbsoluteTimeGetCurrent()
}
} catch {
Log.write("tile snapshot failed wid=\(scWindow.windowID): \(error)")
Expand Down Expand Up @@ -435,8 +435,6 @@ final class Tile: NSObject, SCStreamOutput, SCStreamDelegate {
}
}

guard significantChange || !hasRenderedLiveFrame else { return }

self.lastPixelBuffer = pixelBuffer

if suppressFrames { return }
Expand Down
Loading