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

@ -175,8 +175,8 @@ handle_surface_commit(struct wl_listener *listener, void *data)
process_keyboard_interactivity(layer);
}
if (committed || layer->mapped != layer_surface->mapped) {
layer->mapped = layer_surface->mapped;
if (committed || layer->mapped != layer_surface->surface->mapped) {
layer->mapped = layer_surface->surface->mapped;
output_update_usable_area(output);
/*
* Update cursor focus here to ensure we
@ -401,10 +401,10 @@ handle_new_layer_surface(struct wl_listener *listener, void *data)
&surface->surface_commit);
surface->map.notify = handle_map;
wl_signal_add(&layer_surface->events.map, &surface->map);
wl_signal_add(&layer_surface->surface->events.map, &surface->map);
surface->unmap.notify = handle_unmap;
wl_signal_add(&layer_surface->events.unmap, &surface->unmap);
wl_signal_add(&layer_surface->surface->events.unmap, &surface->unmap);
surface->new_popup.notify = handle_new_popup;
wl_signal_add(&layer_surface->events.new_popup, &surface->new_popup);