weston-ivi-shell: Send content_state event from ivi-controller.
authorNobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
Mon, 7 Jul 2014 12:19:53 +0000 (21:19 +0900)
committerNobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
Thu, 21 Aug 2014 01:08:13 +0000 (10:08 +0900)
When content of ivi_surface is changes, e.g. map wl_surface or remove
it, content_state is notified.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
weston-ivi-shell/src/ivi-controller.c

index 49c61e6..e9c37a1 100755 (executable)
@@ -1553,6 +1553,7 @@ surface_event_create(struct ivi_layout_surface *layout_surface,
     struct ivishell *shell = userdata;
     struct ivisurface *ivisurf = NULL;
     uint32_t id_surface = 0;
+    struct ivicontroller_surface *ctrlsurf = NULL;
 
     id_surface = ivi_layout_getIdOfSurface(layout_surface);
 
@@ -1561,6 +1562,13 @@ surface_event_create(struct ivi_layout_surface *layout_surface,
         weston_log("failed to create surface");
         return;
     }
+
+    wl_list_for_each(ctrlsurf, &shell->list_controller_surface, link) {
+        if (id_surface != ctrlsurf->id_surface) {
+            continue;
+        }
+        ivi_controller_surface_send_content(ctrlsurf->resource, IVI_CONTROLLER_SURFACE_CONTENT_STATE_CONTENT_AVAILABLE);
+    }
 }
 
 static void
@@ -1599,6 +1607,7 @@ surface_event_remove(struct ivi_layout_surface *layout_surface,
             if (id_surface != ctrlsurf->id_surface) {
                 continue;
             }
+            ivi_controller_surface_send_content(ctrlsurf->resource, IVI_CONTROLLER_SURFACE_CONTENT_STATE_CONTENT_REMOVED);
             ivi_controller_surface_send_destroyed(ctrlsurf->resource);
         }
     }