[PATCH] shell: display the input panel on the active output
Kristian Høgsberg
hoegsberg at gmail.com
Mon Apr 21 14:31:52 PDT 2014
On Thu, Apr 17, 2014 at 02:04:32PM +0200, Manuel Bachmann wrote:
> We now dynamically move the input panel (i.e. virtual
> keyboard) surface to the output containing the currently
> focused surface.
That works, but it does seem like we're missing a link from the
input panel surface to the input context it comes from. That might
be a problem with multi-seat on-screen keyboard situations, but fixing
it requires wl_input_panel protocol changes. Let stick with this for now.
Kristian
>
> 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
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list