-
I'm not too familiar with neither the whole GIO application nor DBus, so please excuse me if I'm asking a stupid question. I understand that a GIO application automatically claims its application ID as bus name on the session bus. At least, I'm seeing the name claimed just by launching my application, without having done anything towards DBus registration. Now, I'd like to export an object under that bus name. #1248 suggests I should use zbus, but with the bus name already claimed by the
So, how do I get my own object to appear under my app's bus name? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
For using GDbus, the API works basically the same as in C. In other words, not very convenient until someone puts some effort into making it nicer to use (e.g. via zbus-style macros). https://github.com/gtk-rs/gtk-rs-core/blob/main/examples/gio_dbus_register_object/main.rs is an example that probably answers your question. |
Beta Was this translation helpful? Give feedback.
GApplication
registers your application's name on the bus. If you want to use zbus you need to select a different name for that and have a separate dbus connection.For using GDbus, the API works basically the same as in C. In other words, not very convenient until someone puts some effort into making it nicer to use (e.g. via zbus-style macros). https://github.com/gtk-rs/gtk-rs-core/blob/main/examples/gio_dbus_register_object/main.rs is an example that probably answers your question.