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

xdg shell: Introduce reset_initial_configure_sent() #1542

Merged

Conversation

PolyMeilex
Copy link
Member

As far as I can tell, the xdg initial configure dance has to be done every time a xdg surface remaps itself.

So this MR:

  • introduced a simple reset_initial_configure_sent helper method for xdg_surface, that allows to reset initial_configure_sent/initial_decoration_configure_sent to false.
  • fixes remapping in anvil
  • introduces a simple test client collection crate, for now it has a remap cycle client, that does the remapping in an endless loop.

Spec quote relating to this behavior:

For an xdg_surface to be mapped by the compositor, the following conditions must be met:
(1) the client has assigned an xdg_surface-based role to the surface
(2) the client has set and committed the xdg_surface state and the role-dependent state to the surface
(3) the client has committed a buffer to the surface

A newly-unmapped surface is considered to have met condition (1) out of the 3 required conditions
for mapping a surface if its role surface has not been destroyed,
i.e. the client must perform the initial commit again before attaching a buffer.

@PolyMeilex PolyMeilex changed the title xdg shell: Allow to reset_initial_configure_sent() xdg shell: Introduce reset_initial_configure_sent() Sep 20, 2024
@YaLTeR
Copy link
Contributor

YaLTeR commented Sep 20, 2024

Another test client: wleird-unmap

@Drakulix
Copy link
Member

Hmm, why can't we do this automatically inside smithay, when we get a null-buffer attached?

@PolyMeilex PolyMeilex force-pushed the xdg-shell-reset-initial-configure-sent branch 2 times, most recently from e97a2a6 to 14fd1da Compare October 24, 2024 19:48
@PolyMeilex
Copy link
Member Author

Hmm, why can't we do this automatically inside smithay, when we get a null-buffer attached?

Done, as long as the user uses Smithay's rendering abstractions this will now happen automatically. For any other case, the manual reset methods remain.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 23.80952% with 32 lines in your changes missing coverage. Please review.

Project coverage is 19.69%. Comparing base (d5cedee) to head (14fd1da).
Report is 16 commits behind head on master.

Files with missing lines Patch % Lines
src/wayland/shell/xdg/mod.rs 23.80% 32 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1542      +/-   ##
==========================================
+ Coverage   19.66%   19.69%   +0.02%     
==========================================
  Files         169      169              
  Lines       27749    27851     +102     
==========================================
+ Hits         5456     5484      +28     
- Misses      22293    22367      +74     
Flag Coverage Δ
wlcs-buffer 17.12% <23.80%> (+0.04%) ⬆️
wlcs-core 16.86% <23.80%> (+0.04%) ⬆️
wlcs-output 6.88% <0.00%> (-0.03%) ⬇️
wlcs-pointer-input 18.63% <23.80%> (+0.02%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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!

src/wayland/shell/xdg/mod.rs Outdated Show resolved Hide resolved
@PolyMeilex PolyMeilex force-pushed the xdg-shell-reset-initial-configure-sent branch from 14fd1da to 85a60b5 Compare October 25, 2024 21:08
@PolyMeilex PolyMeilex merged commit de5ad9e into Smithay:master Oct 25, 2024
13 checks passed
@PolyMeilex PolyMeilex deleted the xdg-shell-reset-initial-configure-sent branch October 25, 2024 21:15
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.

4 participants