Not sure if this is intentional, but placing the ref increment here changes the ownership semantics, leading to protocol errors in games (due to a premature release of client surface).
It's not intentional, I had actually found that shared ownership very slippery... and I slipped.
On related note: how likely is for 'wl_subcompositor_get_subsurface' to fail and would it make sense to keep the error path? It was dropped within the second commit.
I would say it's unlikely enough and there's an error message printed out if it ever fails. Handling the error was complicating the code unnecessarily IMO.