[PATCH] shell: display the input panel on the active output

Manuel Bachmann manuel.bachmann at open.eurogiciel.org
Thu Apr 17 05:10:57 PDT 2014


This patch fixes :

https://bugs.freedesktop.org/show_bug.cgi?id=71015

Regards,
Manuel


2014-04-17 14:04 GMT+02:00 Manuel Bachmann <
manuel.bachmann at open.eurogiciel.org>:

> We now dynamically move the input panel (i.e. virtual
> keyboard) surface to the output containing the currently
> focused surface.
>
> Signed-off-by: Manuel Bachmann <manuel.bachmann at open.eurogiciel.org>
> ---
>  desktop-shell/input-panel.c |   14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/desktop-shell/input-panel.c b/desktop-shell/input-panel.c
> index 12fe686..d5e7d71 100644
> --- a/desktop-shell/input-panel.c
> +++ b/desktop-shell/input-panel.c
> @@ -54,6 +54,9 @@ show_input_panels(struct wl_listener *listener, void
> *data)
>                 container_of(listener, struct desktop_shell,
>                              show_input_panel_listener);
>         struct input_panel_surface *ipsurf, *next;
> +       struct weston_seat *seat;
> +       struct weston_surface *focus;
> +       float x, y;
>
>         shell->text_input.surface = (struct weston_surface*)data;
>
> @@ -70,6 +73,17 @@ show_input_panels(struct wl_listener *listener, void
> *data)
>                               &shell->input_panel.surfaces, link) {
>                 if (ipsurf->surface->width == 0)
>                         continue;
> +
> +               wl_list_for_each(seat, &shell->compositor->seat_list,
> link) {
> +                       if (!seat->keyboard)
> +                               continue;
> +                       focus =
> weston_surface_get_main_surface(seat->keyboard->focus);
> +                       ipsurf->output = focus->output;
> +                       x = ipsurf->output->x + (ipsurf->output->width -
> ipsurf->surface->width) / 2;
> +                       y = ipsurf->output->y + ipsurf->output->height -
> ipsurf->surface->height;
> +                       weston_view_set_position(ipsurf->view, x, y);
> +               }
> +
>                 wl_list_insert(&shell->input_panel_layer.view_list,
>                                &ipsurf->view->layer_link);
>                 weston_view_geometry_dirty(ipsurf->view);
> --
> 1.7.10.4
>
>


-- 
Regards,



*Manuel BACHMANN Tizen Project VANNES-FR*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20140417/f4ef3cbb/attachment-0001.html>


More information about the wayland-devel mailing list