This commit implements the function
ivi_layout_get_keyboard_focus_surface_id.
Note: This function is not used by wayland-ivi-extension's
ivi-controller, so it has not been tested for correct behaviour,
only that it seems correct and compiles successfully.
original patch backported to upstream Weston ivi-shell:
79e4a00 by Jonathan Maw <jonathan.maw@codethink.co.uk> on 15 of Aug 2014
Change-Id: I50c994113e45c351a9bceabcc66c77e3d480adc7
/**
+ * \brief Get the indentifier of the surface which hold the keyboard focus
+ *
+ * \return 0 if the method call was successful
+ * \return -1 if the method call was failed
+ */
+int32_t
+ivi_layout_get_keyboard_focus_surface_id(struct ivi_layout_surface **pSurfaceId);
+
+/**
* \brief Set the destination area of a surface within a layer for rendering.
*
* The surface will be scaled to this rectangle for rendering.
return 0;
}
+WL_EXPORT int32_t
+ivi_layout_get_keyboard_focus_surface_id(struct ivi_layout_surface **pSurfaceId)
+{
+ struct wl_list *surface_list = &get_layout_instance()->surface_list;
+ struct ivi_layout_surface *current_surf;
+
+ if (surface_list == NULL) {
+ weston_log("%s: surface list is NULL\n", __FUNCTION__);
+ return -1;
+ }
+
+ wl_list_for_each(current_surf, surface_list, link) {
+ if (current_surf->prop.has_keyboard_focus != 0) {
+ *pSurfaceId = current_surf;
+ break;
+ }
+ }
+
+ return 0;
+}
+
WL_EXPORT int32_t
ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf,