layout: Keep track of popup state to handle activation 72/27572/2
authorMarius Vlad <marius.vlad@collabora.com>
Mon, 30 May 2022 17:17:36 +0000 (20:17 +0300)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Fri, 10 Jun 2022 21:24:54 +0000 (21:24 +0000)
Upon deactivation explicitly mark the surface as unmapped, and keep
track of the state using the enum already added for that.

Further more, at remap, we need to perform a transform update, so this
adds that as well.

Together with these changes, we now can activate/hide the pop-up window
correctly.

Bug-AGL: SPEC-4412
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I4dda48dbda265d19df9c7fb4a25773afa8245cf3

src/ivi-compositor.h
src/layout.c

index 5137d19..78d1acd 100644 (file)
@@ -271,6 +271,7 @@ struct ivi_surface {
                NORMAL,
                RESIZING,
                FULLSCREEN,
+               HIDDEN,
        } state;
 
        enum ivi_surface_role role;
index dd4abb5..be65c6c 100644 (file)
@@ -648,7 +648,7 @@ ivi_layout_popup_committed(struct ivi_surface *surface)
            !surface->mapped)
                return;
 
-       if (surface->view->is_mapped)
+       if (surface->view->is_mapped || surface->state == HIDDEN)
                return;
 
        assert(surface->role == IVI_SURFACE_ROLE_POPUP);
@@ -658,6 +658,7 @@ ivi_layout_popup_committed(struct ivi_surface *surface)
        ivi_compute_popup_position(woutput, view,
                                   surface->popup.x, surface->popup.y, &new_x, &new_y);
        weston_view_set_position(view, new_x, new_y);
+       weston_view_update_transform(view);
 
        /* only clip the pop-up dialog window if we have a valid
         * width and height being passed on. Users might not want to have one
@@ -706,6 +707,7 @@ ivi_layout_popup_re_add(struct ivi_surface *surface)
        if (!surface->mapped)
                surface->mapped = true;
 
+       surface->state = NORMAL;
        ivi_layout_popup_committed(surface);
 }
 
@@ -924,6 +926,9 @@ ivi_layout_deactivate(struct ivi_compositor *ivi, const char *app_id)
        } else if (surf->role == IVI_SURFACE_ROLE_POPUP) {
                struct weston_view *view  = surf->view;
 
+               weston_view_unmap(view);
+               surf->state = HIDDEN;
+
                weston_layer_entry_remove(&view->layer_link);
                weston_view_geometry_dirty(view);
                weston_surface_damage(view->surface);