using libinput with glib's signal_timeout

Peter Hutterer peter.hutterer at
Mon Nov 6 06:48:17 UTC 2023

On Fri, Nov 03, 2023 at 11:12:27AM +0100, kyomawolf wrote:
> Hey Guys,
> currently I'm trying to use a libinput's eventloop. It used to work as a standalone, but when I tried to put it into Glib::signal_timeout it seems to not receive any events anymore. Do you know more about why this is happening?
> I put a simple example of what I mean in the attachment.
> Greetings Kyomawolf

rough guess: you're not calling libinput_dispatch() when there's data on
the libinput_get_fd(). libinput doesn't work in a thread, it only does
things when you call libinput_dispatch() and that again may (or may not)
result in events being available.

IOW, unless you call libinput_dispatch(), nothing happens.

also - if in doubt enable debug logging so you can see what libinput
does during dispatch, that might provide some info too.


More information about the wayland-devel mailing list