Currently agl-compositor notifies about application ids which can be
activated/deactivated, as well as the application state. However, when
an application is destroyed this information is not communicated to desktop
making it out of sync with the actual list of available applications.
To overcome this limitation extend the protocol and the logic to notify
about application destruction on surface remove.
Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Change-Id: Ib766cf3f3fbd10f55b85212480dc4717ab1bec22
<enum name="app_state">
<entry name="activated" value="0"/>
<entry name="deactivated" value="1"/>
<enum name="app_state">
<entry name="activated" value="0"/>
<entry name="deactivated" value="1"/>
+ <entry name="destroyed" value="2"/>
</enum>
<event name="application">
</enum>
<event name="application">
#include <libweston/libweston.h>
#include <libweston-desktop/libweston-desktop.h>
#include <libweston/libweston.h>
#include <libweston-desktop/libweston-desktop.h>
+#include "agl-shell-desktop-server-protocol.h"
+
#if 0
static struct weston_output *
get_default_output(struct weston_compositor *compositor)
#if 0
static struct weston_output *
get_default_output(struct weston_compositor *compositor)
weston_desktop_surface_get_user_data(dsurface);
struct weston_surface *wsurface =
weston_desktop_surface_get_surface(dsurface);
weston_desktop_surface_get_user_data(dsurface);
struct weston_surface *wsurface =
weston_desktop_surface_get_surface(dsurface);
+ const char *app_id = NULL;
struct ivi_output *output = ivi_layout_get_output_from_surface(surface);
wl_list_remove(&surface->listener_advertise_app.link);
surface->listener_advertise_app.notify = NULL;
struct ivi_output *output = ivi_layout_get_output_from_surface(surface);
wl_list_remove(&surface->listener_advertise_app.link);
surface->listener_advertise_app.notify = NULL;
+ app_id = weston_desktop_surface_get_app_id(dsurface);
+
/* special corner-case, pending_surfaces which are never activated or
* being assigned an output might land here so just remove the surface;
*
/* special corner-case, pending_surfaces which are never activated or
* being assigned an output might land here so just remove the surface;
*
skip_output_asignment:
weston_log("Removed surface %p, app_id %s, role %s\n", surface,
skip_output_asignment:
weston_log("Removed surface %p, app_id %s, role %s\n", surface,
- weston_desktop_surface_get_app_id(dsurface),
- ivi_layout_get_surface_role_name(surface));
+ app_id, ivi_layout_get_surface_role_name(surface));
+
+ shell_advertise_app_state(output->ivi, app_id,
+ NULL, AGL_SHELL_DESKTOP_APP_STATE_DESTROYED);
wl_list_remove(&surface->link);
wl_list_remove(&surface->link);