Skip to content

xwm: replace LATE_SURFACE_ID#869

Merged
Drakulix merged 1 commit intomasterfrom
feature/xwm
Jan 22, 2023
Merged

xwm: replace LATE_SURFACE_ID#869
Drakulix merged 1 commit intomasterfrom
feature/xwm

Conversation

@Drakulix
Copy link
Member

The current mechanism by which x11 window ids and their corresponding wl_surfaces are matched, may inject a LATE_SURFACE_ID client message similar to the original WL_SURFACE_ID message.

The problem with injecting this message is, that to do that it utilizes the same SyncSender, that is internally used by the X11Source. Given that this sender is sync and limited to 5 in-flight messages, queuing up additional messages from the same thread, that runs the calloop event loop and receives these messages may cause a deadlock. This can often be encountered when multiple windows are spawned by a client at the same time.

Instead of making the channel unbound this PR avoids the problem by changing the mechanism all together. Instead of injecting a message, the xwm state is accessed by an idle callback, which isn't prone to cause a deadlock.

@codecov-commenter
Copy link

Codecov Report

Base: 25.27% // Head: 25.25% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (8f4a697) compared to base (0630a22).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #869      +/-   ##
==========================================
- Coverage   25.27%   25.25%   -0.02%     
==========================================
  Files         130      130              
  Lines       20882    20882              
==========================================
- Hits         5277     5274       -3     
- Misses      15605    15608       +3     
Flag Coverage Δ
wlcs-core 22.64% <100.00%> (ø)
wlcs-output 10.38% <0.00%> (ø)
wlcs-pointer-input 24.56% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
anvil/src/shell/mod.rs 41.40% <100.00%> (ø)
src/output.rs 66.89% <0.00%> (-2.03%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@PolyMeilex PolyMeilex left a comment

Choose a reason for hiding this comment

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

LGTM

Kinda off topic, do you think Xwayland shell will help a bit with this convoluted event order dance?

@Drakulix
Copy link
Member Author

LGTM

Kinda off topic, do you think Xwayland shell will help a bit with this convoluted event order dance?

Yes, because it eliminates the race. It requires a relatively recent Xwayland version though, which why I think we will need to keep the old code path for some time anyway.

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