revert clickthrough change, stop propagation on overlay buttons so startDragging doesn't intercept clicks

This commit is contained in:
2026-05-29 17:02:19 +03:00
parent 21898a6d6a
commit d08d464395
2 changed files with 3 additions and 17 deletions
+1 -15
View File
@@ -799,24 +799,10 @@ fn start_overlay_clickthrough_poll(app: AppHandle, shutdown: Arc<AtomicBool>) {
continue;
}
// During recording, the overlay should always be click-through.
// start_capture already sets ignore_cursor_events(true). Skip polling
// so we don't fight it.
// When not recording, the overlay must be interactive (close button, drag, etc).
let state = app.state::<AppState>();
let is_recording = lock(&state.capture).is_some();
if is_recording {
if last_inner != Some(true) {
let _ = overlay.set_ignore_cursor_events(true);
last_inner = Some(true);
}
continue;
} else {
// Not recording - overlay must be interactive
if last_inner != Some(false) {
let _ = overlay.set_ignore_cursor_events(false);
last_inner = Some(false);
}
last_inner = Some(true);
continue;
}
+2 -2
View File
@@ -107,7 +107,7 @@
<span class="grip" aria-hidden="true">::</span>
<span class="dims" aria-label="dimensions">{width} x {height}</span>
<div class="spacer"></div>
<button class="pick-btn" onclick={openPicker} title="snap to window" aria-label="snap capture frame to a window">
<button class="pick-btn" onclick={openPicker} onmousedown={(e) => e.stopPropagation()} title="snap to window" aria-label="snap capture frame to a window">
<svg width="10" height="10" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round">
<rect x="1" y="1" width="4" height="4" rx="0.5"/>
<rect x="7" y="1" width="4" height="4" rx="0.5"/>
@@ -115,7 +115,7 @@
<rect x="7" y="7" width="4" height="4" rx="0.5"/>
</svg>
</button>
<button class="close-btn" onclick={closeOverlay} title="close frame" aria-label="close capture frame">
<button class="close-btn" onclick={closeOverlay} onmousedown={(e) => e.stopPropagation()} title="close frame" aria-label="close capture frame">
<svg width="10" height="10" viewBox="0 0 10 10" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round">
<line x1="2" y1="2" x2="8" y2="8"/>
<line x1="8" y1="2" x2="2" y2="8"/>