Skip to content

Commit c77b887

Browse files
committed
capture: restrict auto-exit to clipboard-only
Auto mode now only exits for clipboard-only captures. Clarify docs and CLI help for auto clipboard exit.
1 parent 31cf2e2 commit c77b887

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

config.example.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,8 @@ format = "png"
333333
copy_to_clipboard = true
334334

335335
# Exit overlay after any capture completes (forces exit for all capture types)
336-
# When false, clipboard captures may still auto-exit depending on defaults.
336+
# When false, clipboard-only captures still auto-exit by default.
337+
# Use --no-exit-after-capture to keep the overlay open for a run.
337338
exit_after_capture = false
338339

339340
# ═══════════════════════════════════════════════════════════════════════════════

docs/CONFIG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,8 @@ format = "png"
335335
copy_to_clipboard = true
336336

337337
# Exit the overlay after any capture completes (forces exit for all capture types)
338-
# When false, clipboard captures may still auto-exit depending on defaults.
338+
# When false, clipboard-only captures still auto-exit by default.
339+
# Use --no-exit-after-capture to keep the overlay open for a run.
339340
exit_after_capture = false
340341
```
341342

src/backend/wayland/state/capture.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@ use super::*;
22

33
impl WaylandState {
44
fn should_exit_after_capture(&self, destination: CaptureDestination) -> bool {
5-
let is_clipboard = matches!(
6-
destination,
7-
CaptureDestination::ClipboardOnly | CaptureDestination::ClipboardAndFile
8-
);
5+
let is_clipboard_only = matches!(destination, CaptureDestination::ClipboardOnly);
96
match self.exit_after_capture_mode {
107
ExitAfterCaptureMode::Always => true,
118
ExitAfterCaptureMode::Never => false,
12-
ExitAfterCaptureMode::Auto => is_clipboard,
9+
ExitAfterCaptureMode::Auto => is_clipboard_only,
1310
}
1411
}
1512

src/config/types.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,8 @@ pub struct CaptureConfig {
768768
#[serde(default = "default_capture_clipboard")]
769769
pub copy_to_clipboard: bool,
770770

771-
/// Exit the overlay after any capture completes (forces exit for all capture types)
771+
/// Exit the overlay after any capture completes (forces exit for all capture types).
772+
/// When false, clipboard-only captures still auto-exit by default.
772773
#[serde(default = "default_capture_exit_after")]
773774
pub exit_after_capture: bool,
774775
}

src/main.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ struct Cli {
9898
)]
9999
freeze: bool,
100100

101-
/// Exit the overlay after a capture completes
101+
/// Exit the overlay after a capture completes (overrides auto clipboard exit)
102102
#[arg(long, action = ArgAction::SetTrue, conflicts_with = "no_exit_after_capture")]
103103
exit_after_capture: bool,
104104

105-
/// Keep the overlay open after a capture completes
105+
/// Keep the overlay open after capture (disables auto clipboard exit)
106106
#[arg(long, action = ArgAction::SetTrue, conflicts_with = "exit_after_capture")]
107107
no_exit_after_capture: bool,
108108

@@ -241,8 +241,12 @@ fn run() -> anyhow::Result<()> {
241241
);
242242
println!(" wayscriber -a, --active Show overlay immediately (one-shot mode)");
243243
println!(" wayscriber --freeze Start overlay already frozen");
244-
println!(" wayscriber --exit-after-capture Exit overlay after a capture completes");
245-
println!(" wayscriber --no-exit-after-capture Keep overlay open after capture");
244+
println!(
245+
" wayscriber --exit-after-capture Exit overlay after a capture completes (override auto clipboard exit)"
246+
);
247+
println!(
248+
" wayscriber --no-exit-after-capture Keep overlay open (disable auto clipboard exit)"
249+
);
246250
println!(" wayscriber --no-tray Skip system tray (headless daemon)");
247251
println!(" wayscriber --about Show the About window");
248252
println!(

0 commit comments

Comments
 (0)