diff options
author | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2014-08-15 12:49:23 +0000 |
---|---|---|
committer | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> | 2014-11-06 17:09:38 +0900 |
commit | 79e4a00b63aa431e3f151f55ff71a21966c82dfe (patch) | |
tree | 5c8f2cc0afb0a4bd8cdf9866f3b1103de1e35382 | |
parent | dd01ca51e0699e188ba98e599f4f34ae5a1bab9c (diff) | |
download | weston-79e4a00b63aa431e3f151f55ff71a21966c82dfe.tar.gz |
ivi-shell: Implement ivi_layout_GetKeyboardFocusSurfaceId
This commit implements the function
ivi_layout_GetKeyboardFocusSurfaceId.
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.
Signed-off-by: James Thomas <james.thomas@codethink.co.uk>
-rw-r--r-- | ivi-shell/ivi-layout.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index e7ac2f14..8ced2f62 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -2461,8 +2461,20 @@ ivi_layout_SetKeyboardFocusOn(struct ivi_layout_surface *ivisurf) WL_EXPORT int32_t ivi_layout_GetKeyboardFocusSurfaceId(struct ivi_layout_surface **pSurfaceId) { - /* TODO */ - (void)pSurfaceId; + struct wl_list *surface_list = &get_instance()->list_surface; + 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.hasKeyboardFocus != 0) { + *pSurfaceId = current_surf; + break; + } + } return 0; } |