Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

layer-shell: replace close() with destroy() #3108

Merged
merged 1 commit into from
Aug 14, 2021

Conversation

ifreund
Copy link
Member

@ifreund ifreund commented Aug 12, 2021

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.

@emersion
Copy link
Member

Ideally we should make the layer-surface inert when the compositor decides to close it…

@ifreund ifreund force-pushed the layer-surface-ignore-closed branch from adf3020 to 7194d0c Compare August 12, 2021 20:57
@ifreund
Copy link
Member Author

ifreund commented Aug 12, 2021

Ideally we should make the layer-surface inert when the compositor decides to close it…

Yep, that's cleaner. Done.

@ifreund ifreund force-pushed the layer-surface-ignore-closed branch from 7194d0c to 135a1f4 Compare August 12, 2021 22:04
@ifreund ifreund changed the title layer-shell: ignore all requests if surface is closed @ifreund layer-shell: make surfaces inert on close Aug 12, 2021
@ifreund ifreund changed the title @ifreund layer-shell: make surfaces inert on close layer-shell: make surfaces inert on close Aug 12, 2021
@ifreund
Copy link
Member Author

ifreund commented Aug 12, 2021

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.

@emersion emersion added the breaking Breaking change in public API label Aug 13, 2021
Copy link
Member

@emersion emersion left a 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.

@ifreund ifreund force-pushed the layer-surface-ignore-closed branch from 135a1f4 to 43e013c Compare August 13, 2021 11:16
@ifreund ifreund changed the title layer-shell: make surfaces inert on close layer-shell: replace close() with destroy() Aug 13, 2021
@ifreund
Copy link
Member Author

ifreund commented Aug 13, 2021

@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.
@ifreund ifreund force-pushed the layer-surface-ignore-closed branch from 43e013c to 41ab4b2 Compare August 13, 2021 11:18
Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

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

LGTM

@emersion emersion merged commit 3364eec into swaywm:master Aug 14, 2021
@emersion
Copy link
Member

Thanks!

@emersion emersion mentioned this pull request Aug 14, 2021
emersion added a commit to swaywm/sway that referenced this pull request Aug 14, 2021
Update for the wlroots breaking change in [1].

[1]: swaywm/wlroots#3108
@ifreund ifreund deleted the layer-surface-ignore-closed branch August 15, 2021 12:12
johanmalm added a commit to labwc/labwc that referenced this pull request Aug 16, 2021
Update for the wlroots breaking change in
swaywm/wlroots#3108
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking Breaking change in public API
Development

Successfully merging this pull request may close these issues.

None yet

2 participants