Chase wlroots: Unified mapping

Need to handle new unified mapping, where mapping is attached to the
wlr_surface objects instead of their parents. Also, most of them require
a new associate event for xsurface objects, their surface member will be
NULL before this event is received.

Refactored by jlindgren:
- add struct mappable
- unify map/unmap logic
This commit is contained in:
Christopher Snowhill 2023-06-15 02:35:43 -07:00 committed by Johan Malm
parent bf576e97de
commit d7dc6e01b4
10 changed files with 142 additions and 52 deletions

View file

@ -163,20 +163,6 @@ set_pending_configure_serial(struct view *view, uint32_t serial)
CONFIGURE_TIMEOUT_MS);
}
static void
handle_map(struct wl_listener *listener, void *data)
{
struct view *view = wl_container_of(listener, view, map);
view->impl->map(view);
}
static void
handle_unmap(struct wl_listener *listener, void *data)
{
struct view *view = wl_container_of(listener, view, unmap);
view->impl->unmap(view, /* client_request */ true);
}
static void
handle_destroy(struct wl_listener *listener, void *data)
{
@ -688,8 +674,7 @@ xdg_surface_new(struct wl_listener *listener, void *data)
/* In support of xdg popups */
xdg_surface->surface->data = tree;
CONNECT_SIGNAL(xdg_surface, view, map);
CONNECT_SIGNAL(xdg_surface, view, unmap);
view_connect_map(view, xdg_surface->surface);
CONNECT_SIGNAL(xdg_surface, view, destroy);
struct wlr_xdg_toplevel *toplevel = xdg_surface->toplevel;