Skip to content

image-copy: Do not panic on ImageCaptureSourceKind::Destroyed#2190

Open
ids1024 wants to merge 1 commit intomasterfrom
image-copy-destroyed_noble
Open

image-copy: Do not panic on ImageCaptureSourceKind::Destroyed#2190
ids1024 wants to merge 1 commit intomasterfrom
image-copy-destroyed_noble

Conversation

@ids1024
Copy link
Member

@ids1024 ids1024 commented Mar 12, 2026

The way this was handled previously is incorrect. We should still handle creation of a capture session, just send stopped when it is created.

This can be tested by creating a capture source and session for a workspace that has been removed. Toplevel and output sources have a different issue in smithay: Smithay/smithay#1961

Should fix pop-os/cosmic-epoch#3319.

https://gist.github.com/ids1024/808358ed4671af7a8b31edc97a45cccc has a minimal test client using cosmic-client-toolkit to reproduce the issue; by trying to create a capture session for a workspace as soon as it is removed. Prior to this PR, that crashed the compositor when a workspace is removed. After it, the compositor runs fine, and that shows the capture session is stopped.

  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

The way this was handled previously is incorrect. We should still handle
creation of a capture session, just send `stopped` when it is created.

This can be tested by creating a capture source and session for a
workspace that has been removed. Toplevel and output sources have a
different issue in `smithay`: Smithay/smithay#1961

Should fix pop-os/cosmic-epoch#3319.
@ids1024 ids1024 requested review from a team March 12, 2026 23:41
Copy link
Member

@Drakulix Drakulix left a comment

Choose a reason for hiding this comment

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

Thanks!

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.

Cosmic crash, unreachable code

2 participants