[PATCH v2 xwayland] xwayland: implement repeat_info event
Pekka Paalanen
ppaalanen at gmail.com
Wed Aug 19 02:32:27 PDT 2015
On Wed, 19 Aug 2015 11:00:09 +0200
Marek Chalupa <mchqwerty at gmail.com> wrote:
> xwayland windows ignored any key repeating settings
> advertised by a compositor
>
> v2. don't hardcode version 4 of seat
> use AutoRepeatModeOn/Off
>
> Signed-off-by: Marek Chalupa <mchqwerty at gmail.com>
> ---
> hw/xwayland/xwayland-input.c | 37 ++++++++++++++++++++++++++++++++++---
> 1 file changed, 34 insertions(+), 3 deletions(-)
>
> diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
> index a961e30..981891e 100644
> --- a/hw/xwayland/xwayland-input.c
> +++ b/hw/xwayland/xwayland-input.c
...
> static const struct wl_keyboard_listener keyboard_listener = {
> keyboard_handle_keymap,
> keyboard_handle_enter,
> keyboard_handle_leave,
> keyboard_handle_key,
> keyboard_handle_modifiers,
> + keyboard_handle_repeat_info,
> };
>
> static DeviceIntPtr
> @@ -534,7 +565,7 @@ static const struct wl_seat_listener seat_listener = {
> };
>
> static void
> -create_input_device(struct xwl_screen *xwl_screen, uint32_t id)
> +create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version)
> {
> struct xwl_seat *xwl_seat;
>
> @@ -548,7 +579,7 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id)
> xorg_list_add(&xwl_seat->link, &xwl_screen->seat_list);
>
> xwl_seat->seat =
> - wl_registry_bind(xwl_screen->registry, id, &wl_seat_interface, 3);
> + wl_registry_bind(xwl_screen->registry, id, &wl_seat_interface, version);
Hi,
here you want to use min(version, 4) to be future-proof, because you
don't implement versions >4. Otherwise the Wayland side looks good to
me.
Thanks,
pq
> xwl_seat->id = id;
>
> xwl_seat->cursor = wl_compositor_create_surface(xwl_screen->compositor);
> @@ -574,7 +605,7 @@ input_handler(void *data, struct wl_registry *registry, uint32_t id,
> struct xwl_screen *xwl_screen = data;
>
> if (strcmp(interface, "wl_seat") == 0 && version >= 3) {
> - create_input_device(xwl_screen, id);
> + create_input_device(xwl_screen, id, version);
> xwl_screen->expecting_event++;
> }
> }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150819/8557faa4/attachment.sig>
More information about the xorg-devel
mailing list