Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use WeakOutput in OutputUserData, Output in WlOutputData #1585

Merged
merged 2 commits into from
Nov 13, 2024

Conversation

ids1024
Copy link
Member

@ids1024 ids1024 commented Nov 13, 2024

Generally it's best not to hold strong references like this in user data, and it's definitely important if we use WeakOutput::is_alive for anything (#1584). In any case, making it weak seems to be easy.

This alone didn't solve the issue I was seeing in cosmic-comp (which pop-os/cosmic-comp#990 addresses, at least for now), so there may be more Output strong references to deal with somewhere...

An `Output` is just a struct containing `OutputData`, so there's no need
for it to exist as a seperate type. Just use `Output`.
There is no need for this to hold a strong reference to the `Output`.

Presumably `WlOutputData` is freed when the global is removed, so it is
correct to hold a strong reference there.
@Drakulix Drakulix merged commit ace2e6a into Smithay:master Nov 13, 2024
13 checks passed
@ids1024 ids1024 deleted the output branch November 14, 2024 00:06
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.

2 participants