diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2024-12-12 15:43:43 +0200 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2025-01-10 11:05:25 +0000 |
commit | 7ba8fc295df6164a2b26560fb0c1975a6ba7be17 (patch) | |
tree | 603c212c0504ebcf91cc43129141131a176fe202 | |
parent | bddc72686d3b5398962ae0131a86aef6b3132bda (diff) |
src: Remove 'mapped' of ivi_surface and use the weston ones
Remove artificial mapped state from a ivi_surface, and rather use the
one from Weston. libweston now has helpers for this so let use those,
rather than inventing one.
Bug-AGL: SPEC-5324
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I785997d4e16049851e7a39451edd34775884ef47
-rw-r--r-- | src/desktop.c | 5 | ||||
-rw-r--r-- | src/ivi-compositor.h | 2 | ||||
-rw-r--r-- | src/layout.c | 31 | ||||
-rw-r--r-- | src/shell.c | 10 |
4 files changed, 12 insertions, 36 deletions
diff --git a/src/desktop.c b/src/desktop.c index ab53601..b327fe6 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -194,7 +194,6 @@ desktop_surface_added(struct weston_desktop_surface *dsurface, void *userdata) surface->ivi = ivi; surface->dsurface = dsurface; surface->role = IVI_SURFACE_ROLE_NONE; - surface->mapped = false; surface->checked_pending = false; wl_list_init(&surface->link); @@ -306,9 +305,7 @@ desktop_surface_removed(struct weston_desktop_surface *dsurface, void *userdata) /* reset the active surface as well */ if (output && output->active && output->active == surface) { - output->active->view->is_mapped = false; - output->active->view->surface->is_mapped = false; - + weston_surface_unmap(output->active->view->surface); weston_view_move_to_layer(output->active->view, NULL); output->active = NULL; } diff --git a/src/ivi-compositor.h b/src/ivi-compositor.h index ea8138a..9c9a212 100644 --- a/src/ivi-compositor.h +++ b/src/ivi-compositor.h @@ -322,7 +322,7 @@ struct ivi_surface { int32_t x, y; int32_t width, height; } pending; - bool mapped; + bool checked_pending; enum { NORMAL, diff --git a/src/layout.c b/src/layout.c index d101014..6c1df75 100644 --- a/src/layout.c +++ b/src/layout.c @@ -624,7 +624,7 @@ ivi_layout_desktop_committed(struct ivi_surface *surf) return; /* we can only activate it again by using the protocol */ - if (surf->mapped) + if (weston_surface_is_mapped(surf->view->surface)) return; /* check first if there aren't any outputs being set */ @@ -632,7 +632,7 @@ ivi_layout_desktop_committed(struct ivi_surface *surf) if (r_output) { struct weston_view *view = r_output->fullscreen_view.fs->view; - if (view->is_mapped || view->surface->is_mapped) + if (weston_view_is_mapped(view)) remove_black_curtain(r_output); } @@ -731,8 +731,7 @@ ivi_layout_fullscreen_committed(struct ivi_surface *surface) geom.height == bg_output->output->height; if (policy && policy->api.surface_activate_by_default && - !policy->api.surface_activate_by_default(surface, surface->ivi) && - !surface->mapped) + !policy->api.surface_activate_by_default(surface, surface->ivi)) return; assert(surface->role == IVI_SURFACE_ROLE_FULLSCREEN); @@ -784,6 +783,7 @@ ivi_layout_fullscreen_committed(struct ivi_surface *surface) if (ivi_seat) ivi_shell_activate_surface(surface, ivi_seat, WESTON_ACTIVATE_FLAG_NONE); + weston_log("Activation completed for app_id %s, role %s, " "output %s\n", app_id, ivi_layout_get_surface_role_name(surface), @@ -840,8 +840,7 @@ ivi_layout_split_committed(struct ivi_surface *surface) int width, height; if (policy && policy->api.surface_activate_by_default && - !policy->api.surface_activate_by_default(surface, surface->ivi) && - !surface->mapped) + !policy->api.surface_activate_by_default(surface, surface->ivi)) return; if (weston_view_is_mapped(surface->view)) @@ -954,8 +953,7 @@ ivi_layout_popup_committed(struct ivi_surface *surface) struct weston_view *view = surface->view; if (policy && policy->api.surface_activate_by_default && - !policy->api.surface_activate_by_default(surface, surface->ivi) && - !surface->mapped) + !policy->api.surface_activate_by_default(surface, surface->ivi)) return; if (weston_view_is_mapped(view) || surface->state == HIDDEN) @@ -1007,11 +1005,6 @@ ivi_layout_popup_re_add(struct ivi_surface *surface) weston_surface_unmap(wsurface); } - /* reset the activate by default in order to (still) allow the surface - * to be activaved using the request */ - if (!surface->mapped) - surface->mapped = true; - surface->state = NORMAL; ivi_layout_popup_committed(surface); } @@ -1031,11 +1024,6 @@ ivi_layout_fullscreen_re_add(struct ivi_surface *surface) weston_surface_unmap(wsurface); } - /* reset the activate by default in order to (still) allow the surface - * to be activaved using the request */ - if (!surface->mapped) - surface->mapped = true; - surface->state = NORMAL; ivi_layout_fullscreen_committed(surface); } @@ -1051,11 +1039,6 @@ ivi_layout_surface_is_split_or_fullscreen(struct ivi_surface *surf) surf->role != IVI_SURFACE_ROLE_FULLSCREEN) return false; - /* reset the activate by default in order to (still) allow the surface - * to be activaved using the request */ - if (!surf->mapped) - surf->mapped = true; - wl_list_for_each(is, &ivi->surfaces, link) if (is == surf) return true; @@ -1098,8 +1081,6 @@ ivi_layout_reset_split_surfaces(struct ivi_compositor *ivi) weston_view_move_to_layer(ev, &ivi->normal.view_list); } - output->previous_active->mapped = true; - weston_view_set_output(ev, woutput); _ivi_set_shell_surface_split(output->previous_active, NULL, 0, diff --git a/src/shell.c b/src/shell.c index a529010..0706ec3 100644 --- a/src/shell.c +++ b/src/shell.c @@ -99,7 +99,7 @@ ivi_set_desktop_surface_remote(struct ivi_surface *surface) * just being added */ if (output->fullscreen_view.fs) { view = output->fullscreen_view.fs->view; - if (view->is_mapped || view->surface->is_mapped) + if (weston_view_is_mapped(view)) remove_black_curtain(output); } @@ -973,8 +973,7 @@ output_has_black_curtain(struct ivi_output *output) { return (output->fullscreen_view.fs && output->fullscreen_view.fs->view && - output->fullscreen_view.fs->view->is_mapped && - output->fullscreen_view.fs->view->surface->is_mapped); + weston_surface_is_mapped(output->fullscreen_view.fs->view->surface)); } void @@ -993,8 +992,7 @@ remove_black_curtain(struct ivi_output *output) view = output->fullscreen_view.fs->view; wsurface = view->surface; - assert(view->is_mapped == true || - view->surface->is_mapped == true); + assert(weston_surface_is_mapped(view->surface)); weston_surface_unmap(wsurface); @@ -1018,7 +1016,7 @@ insert_black_curtain(struct ivi_output *output) view = output->fullscreen_view.fs->view; wsurface = view->surface; - if (view->is_mapped || view->surface->is_mapped) + if (weston_surface_is_mapped(wsurface)) return; weston_surface_map(wsurface); |