layout/shell: Add basic support for split window
[src/agl-compositor.git] / src / desktop.c
index 3fd09bc..7875eb9 100644 (file)
@@ -312,6 +312,7 @@ desktop_surface_removed(struct weston_desktop_surface *dsurface, void *userdata)
                output->area = output->area_saved;
        }
 
+
        /* reset the active surface as well */
        if (output && output->active && output->active == surface) {
                output->active->view->is_mapped = false;
@@ -342,6 +343,14 @@ desktop_surface_removed(struct weston_desktop_surface *dsurface, void *userdata)
                weston_view_destroy(surface->view);
        }
 
+       if (surface->role == IVI_SURFACE_ROLE_TILE) {
+               ivi_layout_reset_split_surfaces(surface->ivi);
+               // activate previous when resizing back to give input set
+               // output active for allowing to resizing again if needed
+               if (output->previous_active)
+                       ivi_layout_activate_by_surf(output, output->previous_active);
+       }
+
        /* invalidate agl-shell surfaces so we can re-use them when
         * binding again */
        if (surface->role == IVI_SURFACE_ROLE_PANEL) {