-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Expose dbus_register and dbus_unregister vfuncs #1634
base: main
Are you sure you want to change the base?
Conversation
This is my first time doing glib FFI, so I'd like ask for a careful review, especially around ownership of pointers. If this is accepted I'd very much appreciate a timely backport and release, as I need this to reliably export an object on the bus in my code. |
Mmh, did I cause this CI error? |
No, the docs job is just randomly failing. |
There was a problem hiding this 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 otherwise, thanks :)
179386b
to
f40c7d4
Compare
@bilelmoussaoui @sdroege I think I addressed everything. I added name_lost too; I hope I did it right, because I didn't really understand what the return value does and it doesn't seem to be documented 🤷 |
77d82c5
to
325e4c0
Compare
325e4c0
to
e7fef77
Compare
This is more in line how application classes would be used in real world applications which usually create a derived application class which holds the overall state. And it prepares for testing the dbus_register vfunc subsequently.
e7fef77
to
00fe956
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've addressed all remarks, changed the return value of name_lost
to Propagation
, and rebased onto main.
While I was at it I've pushed another commit which replaces the IOErrorEnum's in the DBus example with |
Using this vfunc makes exporting objects on the app's bus name much easier and more reliable.
I've rewritten the corresponding example to use these two methods, as the GIO docs recommend to use these vfuncs for object registration. Also, registering an object in startup is prone to race conditions wrt to bus ownership as the object gets registered only after the application claimed the bus name.