diff options
author | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> | 2014-11-27 13:25:34 +0900 |
---|---|---|
committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2014-12-04 17:25:50 +0200 |
commit | 0038b738abf6e61b1aacaf1a9026886acd0171f6 (patch) | |
tree | 4e8d665dc49c1f426c028944ccf0f8b7fe6f312d /ivi-shell/ivi-shell.c | |
parent | b1d121d835d4bdf32a69583cf22d28305824ccc8 (diff) | |
download | weston-0038b738abf6e61b1aacaf1a9026886acd0171f6.tar.gz |
ivi-shell: reference implementation of input panel for ivi-shell
- introduces ivi-shell/input-panel-ivi.c which is basically copied
from desktop shell. It shall be improvaded to remove duplicate
implementation.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'ivi-shell/ivi-shell.c')
-rw-r--r-- | ivi-shell/ivi-shell.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index 50894fb9..a14010ec 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -314,6 +314,31 @@ bind_ivi_application(struct wl_client *client, shell, NULL); } +struct weston_view * +get_default_view(struct weston_surface *surface) +{ + struct ivi_shell_surface *shsurf; + struct weston_view *view; + + if (!surface || wl_list_empty(&surface->views)) + return NULL; + + shsurf = get_ivi_shell_surface(surface); + if (shsurf && shsurf->layout_surface) { + view = shsurf->shell->ivi_layout->get_weston_view(shsurf->layout_surface); + if (view) + return view; + } + + wl_list_for_each(view, &surface->views, surface_link) { + if (weston_view_is_mapped(view)) + return view; + } + + return container_of(surface->views.next, + struct weston_view, surface_link); +} + /* * Called through the compositor's destroy signal. */ @@ -324,6 +349,8 @@ shell_destroy(struct wl_listener *listener, void *data) container_of(listener, struct ivi_shell, destroy_listener); struct ivi_shell_surface *ivisurf, *next; + input_panel_destroy(shell); + wl_list_for_each_safe(ivisurf, next, &shell->ivi_surface_list, link) { wl_list_remove(&ivisurf->link); free(ivisurf); @@ -339,6 +366,7 @@ init_ivi_shell(struct weston_compositor *compositor, struct ivi_shell *shell) wl_list_init(&shell->ivi_surface_list); + weston_layer_init(&shell->input_panel_layer, NULL); } static int @@ -413,6 +441,8 @@ module_init(struct weston_compositor *compositor, shell->destroy_listener.notify = shell_destroy; wl_signal_add(&compositor->destroy_signal, &shell->destroy_listener); + if (input_panel_setup(shell) < 0) + return -1; if (wl_global_create(compositor->wl_display, &ivi_application_interface, 1, |