Input event notify or injection in Weston

Josh Simonot jsimonot at
Wed Dec 11 19:33:03 UTC 2019

I've found my answer in compositor-rdp.c which was to simply init and create a seat 🙂 not a big surprise.

struct weston_seat *seat = zalloc(sizeof(*seat));
weston_seat_init(seat, compositor, "my_seat");

I am curious to know why there was an existing seat "default" which did not work?


From: Josh Simonot <jsimonot at>
Sent: December 6, 2019 2:51 PM
To: wayland-devel at <wayland-devel at>
Subject: Input event notify or injection in Weston


I have the need to pass input events from a hypervisor host into a guest running weston.  I already have a custom protocol in weston to share surfaces with the host, and I'm hoping it makes sense to extend it to send input back to the guest.

So does it make sense to route these input events through libweston?  I've found the functions:  notify_key(), notify_button(), notify_motion_absolute(), etc.   I was trying to use these to inject the events but end up causing weston to segfault:

[22:14:37.440] caught signal: 11
[22:14:37.442]   [0000000000405c9a]  --  (weston)
[22:14:37.442]   [0000000000405d07]  --  (weston)
[22:14:37.444]   [00000034a0e34380]  --  (/lib/
[22:14:37.446]   [00000034a321a380]  notify_button  (/usr/lib/
[22:14:37.447]   [00007ff73b747302]  --  (/usr/lib/libweston-3/
[22:14:37.449]   [00000034a1207477]  --  (/lib/
[22:14:37.450]   [00000034a0ef23bf]  clone  (/lib/

I suspect I don't have a valid weston_seat, which I get like this:

struct udev_seat *udev_seat = udev_seat_get_named(input, "default");
struct weston_seat *seat = &udev_seat->base;

Where "default" is the only existing seat in the list.  I didn't create or add any.

  1.  Is this the right approach?  Any hints on how to make it work?
  2.  One alternative I'm considering is to use uinput to create virtual input devices and send the events to that.  Any other alternatives that might be more appropriate than the above?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the wayland-devel mailing list