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

Updated: Fix output-specific images when output reappears #330

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

alexbakker
Copy link
Member

Since #155 hasn't been touched in quite a while, I figured I'd take a shot at dragging it across the finish line. The patch has been rebased and modified to use wl_output instead of xdg_output. The remaining feedback from the previous pull request has also been addressed.

@emersion
Copy link
Member

Hm, this looks a bit fragile. I would suggest moving this

swaylock/main.c

Line 314 in f2298bd

if (state->run_display) {

to handle_wl_output_done instead.

@emersion
Copy link
Member

Would need to add a check to make sure create_surface() only runs once per surface.

When setting an image with `--image <output>:<path>`, the image used to
fail to apply if the relevant output appears some time after swaylock
executes.

Co-authored-by: Alexander Bakker <[email protected]>
@alexbakker
Copy link
Member Author

Alright. How's this?

struct swaylock_surface *surface = data;
if (!surface->created && surface->state->run_display) {
create_surface(surface);
wl_display_roundtrip(surface->state->display);
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is necessary (in fact, I think it's a potential source of bugs), but it was there before so orthogonal to this PR.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants