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

Fire the xdg-surface destroy signal when the role object is destroyed #1407

Closed
emersion opened this issue Dec 3, 2018 · 0 comments
Closed

Comments

@emersion
Copy link
Member

emersion commented Dec 3, 2018

Right now, the lifecycle of a wlr_xdg_surface object is as follows:

  • Client creates a xdg-surface, we allocate a wlr_xdg_surface but the compositor doesn't know about it
  • Client creates a xdg-role-object (e.g. xdg-toplevel). We allocate e.g. a wlr_xdg_toplevel, set the xdg-role and fire the new_xdg_surface event.
  • Client maps the xdg-surface, we emit the map event. Client can map/unmap at will.
  • Client destroys the xdg-role-object, this unmaps the surface. We destroy the wlr_xdg_toplevel, reset the xdg-role and do nothing else.
  • Client destroys the xdg-surface, we fire the destroy event on wlr_xdg_surface

Right after the client destroys the xdg-role-object, the compositor is left with a weird xdg-surface: its xdg-role is set to none. Various xdg-shell functions that operate on the role won't work anymore because the xdg-toplevel is gone.

Instead, we could emit destroy when the xdg-role-object is destroyed, and re-emit new_xdg_surface if the client re-creates it again. This is more consistent with the initial xdg-toplevel creation case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

1 participant