Skip to content

Add option to close window after copying to clipboard#352

Open
kekel87 wants to merge 1 commit intoAlexanderVanhee:mainfrom
kekel87:close-after-copy
Open

Add option to close window after copying to clipboard#352
kekel87 wants to merge 1 commit intoAlexanderVanhee:mainfrom
kekel87:close-after-copy

Conversation

@kekel87
Copy link
Copy Markdown

@kekel87 kekel87 commented Apr 28, 2026

Closes #250.

Adds an opt-in Close After Copying preference under Preferences → Closing.

When enabled, the window closes automatically after a successful Ctrl+C copy. Default is off, so existing behavior is unchanged for current users.

Behavior

  • The close goes through the standard _on_close_request pipeline, so overwrite-screenshot and trash-screenshots-on-close still apply.
  • The existing 1000 ms delayed_destroy in _on_close_finished continues to gate destruction so the Wayland clipboard transfer completes for large images.
  • Skipped when exit-method == "copy" (i.e., "Copy and Close" already selected) to avoid a redundant full pixbuf re-render and a second clipboard write.
  • The implicit post-processing copy (copy_after_processing in set_image, silent=True) is unaffected.

Closes AlexanderVanhee#250
Adds a new "Close After Copying" preference in the existing "Closing" group. When enabled, pressing Ctrl+C (or otherwise triggering the copy action) closes the window once the image has been placed on the clipboard.
Skipped when exit-method is already "copy" to avoid a redundant re-render and second clipboard write.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatically close Gradia after using CTRL+C to copy screenshot

1 participant