-
Notifications
You must be signed in to change notification settings - Fork 341
layer-shell: replace close() with destroy() #3108
Conversation
Ideally we should make the layer-surface inert when the compositor decides to close it… |
adf3020
to
7194d0c
Compare
Yep, that's cleaner. Done. |
7194d0c
to
135a1f4
Compare
Changed this to actually destroy the layer_surface in close() in keeping with the section on inert resources in CONTRIBUTING.md. This is now a breaking change and should be marked as such. |
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.
LGTM! I wonder if we should rename wlr_layer_surface_v1_close
to wlr_layer_surface_v1_destroy
to make it extra-clear that the function will make the layer pointer invalid.
135a1f4
to
43e013c
Compare
@emersion good point, changing the function name will also make it easier for compositors to audit call sites when they update. |
The protocol specifies that all requests (aside from destroy) are ignored after the compositor sends the closed event. Therefore, destroying the wlroots object and rendering the resource inert when sending the closed event keeps things simpler for wlroots and compositors.
43e013c
to
41ab4b2
Compare
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.
LGTM
Thanks! |
Update for the wlroots breaking change in [1]. [1]: swaywm/wlroots#3108
Update for the wlroots breaking change in swaywm/wlroots#3108
The protocol specifies that all requests (aside from destroy) are
ignored after the compositor sends the closed event. Therefore,
destroying the wlroots object and rendering the resource inert
when sending the closed event keeps things simpler for wlroots and
compositors.