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

toplevel-info: Fix race between binding wl_ouput and output_enter #668

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

ids1024
Copy link
Member

@ids1024 ids1024 commented Jul 31, 2024

This fixes an issue with cosmic-panel where, when a workspace is moved back to an output after a monitor is disconnected and reconnected, the panel doesn't hide because cosmic-panel thinks no toplevel is open on that monitor.

After some testing, it seems output_enter isn't being sent here. In particular, the output_leave call happens before the client binds the wl_output, so there is no wl_output to send in an event yet.

This is addressed by keeping track of a set of wl_outputs that we have sent the event to. So if an output is bound, refresh can add it to this list and send the event.

This is not needed for workspaces (though it could be done similarly) since the handle objects are created by server events. So no race should occur as long as the workspaces global is bound before the toplevel info one.

This fixes an issue with `cosmic-panel` where, when a workspace is moved
back to an output after a monitor is disconnected and reconnected, the
panel doesn't hide because `cosmic-panel` thinks no toplevel is open on
that monitor.

After some testing, it seems `output_enter` isn't being sent here. In
particular, the `output_leave` call happens before the client binds the
`wl_output`, so there is no `wl_output` to send in an event yet.

This is addressed by keeping track of a set of `wl_output`s that we have
sent the event to. So if an output is bound, `refresh` can add it to
this list and send the event.

This is not needed for workspaces (though it could be done similarly)
since the handle objects are created by server events. So no race should
occur as long as the workspaces global is bound before the toplevel info
one.
@ids1024 ids1024 requested a review from a team July 31, 2024 21:55
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 for tracking this down!

@Drakulix Drakulix merged commit c1bf410 into master Aug 1, 2024
7 checks passed
@Drakulix Drakulix deleted the toplevel-info branch August 1, 2024 14:35
ids1024 added a commit that referenced this pull request Jan 27, 2025
#668 previously did this for
toplevel events, but missed the fact that the workspaces protocol has
the same issue.

Fixes pop-os/cosmic-workspaces-epoch#61.
ids1024 added a commit that referenced this pull request Jan 27, 2025
#668 previously did this for
toplevel events, but missed the fact that the workspaces protocol has
the same issue.

Fixes pop-os/cosmic-workspaces-epoch#61.
ids1024 added a commit that referenced this pull request Jan 27, 2025
#668 previously did this for
toplevel events, but missed the fact that the workspaces protocol has
the same issue.

Fixes pop-os/cosmic-workspaces-epoch#61.
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.

3 participants