Skip to content
Open
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
6 changes: 5 additions & 1 deletion apps/desktop/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,11 @@ function Inner() {
<Route path="/mode-select" component={ModeSelectPage} />
<Route path="/notifications" component={NotificationsPage} />
<Route path="/recordings-overlay" component={RecordingsOverlayPage} />
<Route path="/screenshot-editor" component={ScreenshotEditorPage} />
<Route
path="/screenshot-editor"
info={{ AUTO_SHOW_WINDOW: false }}
component={ScreenshotEditorPage}
/>
<Route
path="/target-select-overlay"
component={TargetSelectOverlayPage}
Expand Down
6 changes: 5 additions & 1 deletion apps/desktop/src/components/Cropper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,12 @@ export function Cropper(
// While pointer capture is held the drag is still ours even if the window
// loses focus (e.g. another overlay or the camera window grabs it on
// Windows). Real pointer loss arrives via pointercancel/lostpointercapture.
// Defer the capture check by one microtask so setPointerCapture has time
// to finalize before we decide the session is orphaned.
blur: () => {
if (!target.hasPointerCapture?.(pointerId)) finish();
queueMicrotask(() => {
if (!target.hasPointerCapture?.(pointerId)) finish();
});
},
Comment on lines 721 to 725

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block looks like it got duplicated/partially applied (nested blur + stray lines), which should fail to compile. I think this should just be a single blur handler.

Suggested change
blur: () => {
if (!target.hasPointerCapture?.(pointerId)) finish();
Promise.resolve().then(() => {
if (!target.hasPointerCapture?.(pointerId)) finish();
});
if (!target.hasPointerCapture?.(pointerId)) finish();
blur: () => {
Promise.resolve().then(() => {
if (!target.hasPointerCapture?.(pointerId)) finish();
});
},
Promise.resolve().then(() => {
if (!target.hasPointerCapture?.(pointerId)) finish();
});
},
},
blur: () => {
Promise.resolve().then(() => {
if (!target.hasPointerCapture?.(pointerId)) finish();
});
},

});
createEventListenerMap(target, {
Expand Down