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 <[email protected]>
---
 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
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to