U++ Forum - RDF feed
https://www.ultimatepp.org/forums/
DBus integration -- need help
https://www.ultimatepp.org/forums/index.php?t=rview&goto=48544&th=10070#msg_48544
I've converted from X11 to GTK for Upp project config to be compatible with GIO dbus library.
I've created a separate thread for the DBus server and ran into problems with event loop.
I've gutted my DBus server code of everything except what is causing an issue.
DBus GIO examples use GMainLoop in order for DBus to service asynchronous events.
Everything compiles and runs except the main UI is not longer visible. There must be a
GTK main loop already running and I've stepped on it with this code. Is there a way for
me to obtain a pointer to the UI main loop and use it with my DBus server?
How/where can I do that?
Code snipped example as follows:
---- code snippet ----
myDBusServerMainThread()
{
//========================================================== =====
//
// Enter main service loop for this thread
//
while (not needsExit ()) { // colaborate with join()
GMainLoop *loop;
loop = g_main_loop_new(NULL, FALSE);
g_main_loop_run(loop);
}
}
]]>jlfranks2017-07-20T15:30:07-00:00Re: DBus integration -- need help
https://www.ultimatepp.org/forums/index.php?t=rview&goto=48546&th=10070#msg_48546
You could try use following methods of Ctrl to obtain gtk & gdk handlers:
Probably with these two variables you could try to integrate D-BUS. Sometimes ago I plan that innovation for U++, but it will require time to develop that we don't have it too much now. D-Bus could be usefull for develop such features as notification and global menu and probably more.
You could also see our GTK backend code easily. Just go to CtrlLib and analyze the files under "Gtk" separator. Probably there you will find the handling of event loop.
If you guys create something that could be used as library. It would be nice to keep it as open source.
Sincerely and good luck with implementation,
Klugier
]]>Klugier2017-07-20T22:30:17-00:00Re: DBus integration -- need help
https://www.ultimatepp.org/forums/index.php?t=rview&goto=48552&th=10070#msg_48552
I will look into using those suggestions, but we have no time scheduled for this kind of integration.
If I can get something to work, I'll let you know.
-- Jeff
]]>jlfranks2017-07-21T11:30:19-00:00Re: DBus integration -- need help
https://www.ultimatepp.org/forums/index.php?t=rview&goto=48554&th=10070#msg_48554
I've examined the code you suggested and in fact found many elements related to GtK.
What I have not been able to find if the GtK main event loop.
Is there another U++ event loop that is used as the Gtk main event loop?
I've just not been able to identify that component in order to integrate GDbus
into the main loop.
-- Jeff
]]>jlfranks2017-07-21T13:01:09-00:00Re: DBus integration -- need help
https://www.ultimatepp.org/forums/index.php?t=rview&goto=48696&th=10070#msg_48696
You can call Ctrl::ProcessEvents at any time to fetch and process any GUI related pending events (but just from the main thread).
I suggest to post existing code, I can look into it about alternatives...]]>mirek2017-08-25T07:05:53-00:00