shell: Keep a reference to weston_transmitter_surface 79/25479/2
authorMarius Vlad <marius.vlad@collabora.com>
Wed, 21 Oct 2020 20:31:16 +0000 (23:31 +0300)
committerMarius Vlad <marius.vlad@collabora.com>
Thu, 5 Nov 2020 08:41:32 +0000 (10:41 +0200)
When 'pushing' the surface store a reference of the
weston_transmitter_surface so we can later inform the plug-in when the
weston_surface is destroyed, so that it can also destroy the
transmittter_surface from its side.

Bug-AGL: SPEC-3601, SPEC-3611

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I7fd1df2130e53e8c226c7a751c598765608ae6b3

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

index ff8e20d..3dd0c20 100644 (file)
@@ -239,6 +239,14 @@ enum ivi_surface_flags {
        IVI_SURFACE_PROP_POSITION = (1 << 1),
 };
 
+/* the waltham surface is a pointer type as well and
+ * in order to avoid adding ifdef for waltham use a
+ * generic pointer, which will be only be valid when the
+ * surface is a remote out on a waltham type of output */
+struct ivi_surface_waltham {
+       void *transmitter_surface;
+};
+
 struct ivi_surface {
        struct ivi_compositor *ivi;
        struct weston_desktop_surface *dsurface;
@@ -266,6 +274,7 @@ struct ivi_surface {
                struct ivi_remote_surface remote;
        };
 
+       struct ivi_surface_waltham waltham_surface;
        struct wl_listener listener_advertise_app;
        struct wl_signal signal_advertise_app;
 };
index 87d8ce9..0422583 100644 (file)
@@ -159,7 +159,8 @@ ivi_output_notify_waltham_plugin(struct ivi_surface *surface)
         * wthp_ivi_app_id_surface_create() and is responsible for setting-up
         * the gstreamer pipeline as well.
         */
-       api->surface_push_to_remote(weston_surface, app_id, trans_remote, NULL);
+       surface->waltham_surface.transmitter_surface =
+           api->surface_push_to_remote(weston_surface, app_id, trans_remote, NULL);
 }
 
 static void