-
Notifications
You must be signed in to change notification settings - Fork 207
xdg-shell, layer-shell, session-lock: Track last acked configure in MultiCache #1817
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
Conversation
Another question: should this last_acked cached state be reset somewhere upon unmapping? I guess a pre-commit hook would be needed here? (The configured bool in the role should also be reset at that point. Is that bool needed, or is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WmCapabilities checks in Anvil were removed because they are serverside and don't change; not sure what the intention was with those.
Also, added forced configures in unmaximize() and unfullscreen() because they too are required by the protocol.
If that is not too cumbersome, I'd love to split off fixes like this into separate commits.
One kinda weird part is current_server_state() that I had to change to owned return, tbh I would change it to return an Option<&State>, but that would involve changing a bunch of callers. I can do that though if that's better.
It seems like we already cloned it after requesting it in a bunch of places anyway? Seems fine to me honestly.
Another question: should this last_acked cached state be reset somewhere upon unmapping? I guess a pre-commit hook would be needed here?
We had this logic introduced not too (in the grand scheme of things) recently. I guess that logic simply needs to be extended a bit? #1571
386db48
to
688cd1b
Compare
Done. |
688cd1b
to
dec7479
Compare
Pushed a commit that also tracks the configured state through MultiCache last_acked. Also:
Currently testing it on my machine with niri, so far so good. |
I removed |
Would be good to also move popup parent into MultiCache and get rid of |
Uhm so apparently wlcs doesn't bother to ack the initial configure?
(and the server debug for completeness)
|
dec7479
to
3ee763d
Compare
3ee763d
to
8b93492
Compare
Tested on:
Added a FIXME comment mentioning this. |
8b93492
to
4bd0c6f
Compare
I think newer WLCS fixes the ack_configure issue? At least from a quick glance at its repo. How is it usually updated? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1817 +/- ##
==========================================
- Coverage 18.89% 6.81% -12.09%
==========================================
Files 176 177 +1
Lines 27672 27839 +167
==========================================
- Hits 5230 1896 -3334
- Misses 22442 25943 +3501
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mandated by the protocol, same as fullscreen/maximize.
Unclear what they were for. This is compositor-side state that Anvil doesn't change after startup.
The last-acked configure is part of the committed state, and should be tracked as such. Before this commit, it would be possible to observe a newer "current state" in a commit handler if the surface acked the next state while the compositor was waiting on a blocker set in a pre-commit handler. As part of the change, the current_state() getter was replaced by with_committed_state(). Since the "current" state wasn't really a correct thing most of the time, most existing uses of current_state() actually wanted something different, and were corrected in previous commits.
Also: - Removes dependency on renderer abstractions for tracking unmaps. - Removes manual reset_initial_configure() because it's now always automatic. - Makes the check for map before initial configure automatic. - Adds missing role attributes reset on unmap (it only happened on role destroy previously).
Same idea as with xdg-shell in the previous commit.
In theory, allows reusing the wl_surface, consistent with other shells.
Same idea as with xdg-shell in the previous commit.
Contains fixes required for enforcing ack before commit as mandated by the protocols.
3281377
to
1efb695
Compare
Rebased, wrote changelog. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks for working on this!
Qt layer-shell calls grab() first, only then sets popup parent via zwlr_layer_surface_v1::get_popup(). Before this commit, grab() would call the handler immediately, which would see that the popup has no parent, and fail. However, it works on other compositors. The xdg_popup docs don't mention the desired behavior explicitly, though this line could be interpreted in favor of "applying" the grab request at commit time: > The client must call wl_surface.commit on the corresponding wl_surface for > the xdg_popup state to take effect. Fixes grabs from first-level popups on layer-shell Qt clients such as pcmanfm-qt --desktop and lxqt-panel.
Added one commit on top that resolves the popup FIXME and delays the I kept the parent and the new field in the role attributes because they can only be set during the initial commit and cannot change afterward (not sure this is currently enforced in Smithay), so I figured there's no need to put them in the cached state. Tested with: |
Corresponding niri update: YaLTeR/niri@5a4d794
Fixes my fullscreen anim bugs that I found with mpv and adwaita-1-demo.
The last-acked configure is part of the committed state, and should be tracked as such. Before this commit, it would be possible to observe a newer "current state" in a commit handler if the surface acked the next state while the compositor was waiting on a blocker set in a pre-commit handler.
As part of the change, the current_state() getter was removed, because it's confusing and likely not what you actually want. For instance, several uses in Anvil actually needed to access a different state.
The WmCapabilities checks in Anvil were removed because they are serverside and don't change; not sure what the intention was with those.
Also, added forced configures in unmaximize() and unfullscreen() because they too are required by the protocol.
If this is good I'll do a similar refactor for layer-shell and session-lock.
One kinda weird part is
current_server_state()
that I had to change to owned return, tbh I would change it to return anOption<&State>
, but that would involve changing a bunch of callers. I can do that though if that's better.Also, there's a question of whether any other state needs to be moved into Cached?