Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
wlr_* structs should be free'd when the wl_resource is #909
Rationale: it shouldn't be possible to destroy a wlr_* struct without destroying its resource.
Right now, we generally have a
We can't call
So instead we should make
Allowing clients to crash the compositor is a Big Problem. I guess I'll try to do this on one interface, try to reproduce your Problems, and if I can't go on.
I'll have a look at Weston's strategy to deal with this, not sure it's applicable to wlroots though.
Do you remember which problems? I've done it this way in my tablet-v2 branch, and didn't run into any problems yet.
But on that one most (all) structs with resources are hidden from the compositor, and it only interacts with "multiplexer" structs, that have lists of client bindings (kinda like wlr_seat)
Okay, I now remember the reason why this doesn't always work. Wayland has the concept of "inert resources". For instance when a surface which also happens to be a subsurface is destroyed by the client, the subsurface becomes inert.
Being inert means that all requests except the destructor are ignored. Being inert also means being a pain in the ass.
So this needs to be done for resources that can become inert: