Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a ratbag_dispatch() method to allow hooking into a mainloop #359

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

whot
Copy link
Member

@whot whot commented Sep 22, 2017

This is something we'll eventually need when we start monitoring events. We don't have a user for this just yet, so we shouldn't merge it.

I'm sending this as PR now because the code is written and I think that's the approach we want. So once we need it, we can rebase this and push it out.

Copied from libinput with a few renames, this gives us the ability for drivers
to register file descriptors for events and process those events. The calling
process (i.e. ratbagd) needs to call ratbag_dispatch() whenever something
happens on the fd.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Copy link
Collaborator

@bentiss bentiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

We can merge this as soon as there is a user (who wants to shoot first to monitor for profile/dpi changes?)

@Hjdskes
Copy link
Member

Hjdskes commented Sep 29, 2017

Probably missing something obvious here but what would such a user be in this case? We currently have the DBus API that also allows to monitor for changes; and since we don't export libratbag as a library anymore I fail to see how this is relevant.

@whot
Copy link
Member Author

whot commented Sep 29, 2017

any event processing inside libratbag will need it. This is internal API, not external so it's ratbagd that keeps calling into libratbag to process stuff - invisible to the client. Potential users are any driver API that uses e.g. dbus to communicate with some other API (like openrazer)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants