compositor: set data_device keyboard focus in seat_get_keyboard
authorRafal Mielniczuk <rafal.mielniczuk2@gmail.com>
Sun, 17 Feb 2013 14:55:55 +0000 (15:55 +0100)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 18 Feb 2013 22:39:40 +0000 (17:39 -0500)
Because seat_get_keyboard is called after initial
weston_surface_activate, wl_data_device_set_keyboard_focus
fails to send data offer for newly connected client due to
wl_seat.focus_resource being NULL.

This patch calls wl_data_device_set_keyboard_focus
in seat_get_keyboard, so it can send data offer for
newly created client (when wl_keyboard.resource_list
and wl_seat.focus_resource are properly set up).

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

src/compositor.c

index 26fd41a..27e1868 100644 (file)
@@ -2145,6 +2145,7 @@ seat_get_keyboard(struct wl_client *client, struct wl_resource *resource,
            seat->seat.keyboard->focus->resource.client == client) {
                wl_keyboard_set_focus(seat->seat.keyboard,
                                      seat->seat.keyboard->focus);
+               wl_data_device_set_keyboard_focus(&seat->seat);
        }
 }