protocol/grpc-proxy: Add deactivate_app request
[src/agl-compositor.git] / src / shell.c
index 15f911d..b1ef59b 100644 (file)
@@ -1088,7 +1088,8 @@ create_black_curtain_view(struct ivi_output *output)
 bool
 output_has_black_curtain(struct ivi_output *output)
 {
-       return (output->fullscreen_view.fs->view &&
+       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);
 }
@@ -1437,6 +1438,15 @@ shell_activate_app(struct wl_client *client,
        ivi_layout_activate(output, app_id);
 }
 
+static void
+shell_new_deactivate_app(struct wl_client *client, struct wl_resource *shell_res,
+                        const char *app_id)
+{
+       struct ivi_compositor *ivi = wl_resource_get_user_data(shell_res);
+
+       ivi_layout_deactivate(ivi, app_id);
+}
+
 static void
 shell_desktop_activate_app(struct wl_client *client,
                           struct wl_resource *shell_res,
@@ -1517,7 +1527,8 @@ static const struct agl_shell_interface agl_shell_implementation = {
        .set_panel = shell_set_panel,
        .activate_app = shell_activate_app,
        .destroy = shell_destroy,
-       .set_activate_region = shell_set_activate_region
+       .set_activate_region = shell_set_activate_region,
+       .deactivate_app = shell_new_deactivate_app,
 };
 
 static const struct agl_shell_ext_interface agl_shell_ext_implementation = {
@@ -1817,7 +1828,7 @@ int
 ivi_shell_create_global(struct ivi_compositor *ivi)
 {
        ivi->agl_shell = wl_global_create(ivi->compositor->wl_display,
-                                         &agl_shell_interface, 4,
+                                         &agl_shell_interface, 5,
                                          ivi, bind_agl_shell);
        if (!ivi->agl_shell) {
                weston_log("Failed to create wayland global.\n");