xwayland: connect commit and surface_destroy handlers together

Factor out set_surface() which consolidates connecting/disconnecting
the wlr_surface event listeners in one place.

In theory, this means we can receive commit events for minimized views.
However, with a test app that resizes itself, I didn't see any change,
i.e. the commits still don't come through until un-minimize. It's
possible they are being filtered at wlroots or protocol level.

Also remove an old, semi-related TODO from view.c.
This commit is contained in:
John Lindgren 2025-11-07 22:20:18 -05:00 committed by Johan Malm
parent 0501f0ac9e
commit b6f7bacdde
2 changed files with 22 additions and 29 deletions

View file

@ -2479,11 +2479,6 @@ handle_unmap(struct wl_listener *listener, void *data)
view->impl->unmap(view, /* client_request */ true);
}
/*
* TODO: after the release of wlroots 0.17, consider incorporating this
* function into a more general view_set_surface() function, which could
* connect other surface event handlers (like commit) as well.
*/
void
view_connect_map(struct view *view, struct wlr_surface *surface)
{