From 5082ad6b28e2be6da59a0a34d8d8f6adaf0c3da2 Mon Sep 17 00:00:00 2001 From: Manuel Bachmann Date: Thu, 17 Apr 2014 14:04:32 +0200 Subject: [PATCH] shell: display the input panel on the active output We now dynamically move the input panel (i.e. virtual keyboard) surface to the output containing the currently focused surface. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=71015 Signed-off-by: Manuel Bachmann --- desktop-shell/input-panel.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/desktop-shell/input-panel.c b/desktop-shell/input-panel.c index 601b289a..7623f6cb 100644 --- a/desktop-shell/input-panel.c +++ b/desktop-shell/input-panel.c @@ -61,6 +61,19 @@ static void show_input_panel_surface(struct input_panel_surface *ipsurf) { struct desktop_shell *shell = ipsurf->shell; + struct weston_seat *seat; + struct weston_surface *focus; + float x, y; + + 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);