summaryrefslogtreecommitdiff
path: root/desktop-shell/input-panel.c
diff options
context:
space:
mode:
authorManuel Bachmann <manuel.bachmann@open.eurogiciel.org>2014-04-17 14:04:32 +0200
committerKristian Høgsberg <krh@bitplanet.net>2014-04-21 14:34:15 -0700
commit5082ad6b28e2be6da59a0a34d8d8f6adaf0c3da2 (patch)
tree8c827cef8e0ba8db9d78470e73369644a9f2d85c /desktop-shell/input-panel.c
parent4ade0e4a29f4d7313bcc24cacd34596c110f7ba2 (diff)
downloadweston-5082ad6b28e2be6da59a0a34d8d8f6adaf0c3da2.tar.gz
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 <manuel.bachmann@open.eurogiciel.org>
Diffstat (limited to 'desktop-shell/input-panel.c')
-rw-r--r--desktop-shell/input-panel.c13
1 files changed, 13 insertions, 0 deletions
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);