I want to make a web browser in Vala using webkit.
But, I don’t know how to make it multi-process.
I want each tab to have its own process.
How can I do that using Vala and Gtk+.
Thanks for your answer.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Check out
Gtk.PlugandGtk.Socket. You’ll need to put aGtk.Socketin each tab you open. Then spawn a process using one of theGLib.Processfunctions, and in that process construct aGtk.Plugcontaining yourWebView. Then you’ll need some way of inter-process communication, for one thing to connect your plug to your socket, and to pass commands from your user-interface to the webview (such as “make the font larger”).It looks like the Vala documentation doesn’t contain very much explanation, you might want to check out the C documentation for more information on how plugs and sockets work.
EDIT:
You asked for more information on inter-process communication. There are several ways, and I’m not sure which one is the most appropriate for you. Perhaps you can try
GLib.Process.spawn_async_with_pipes()to start your child process and get file descriptors for the child’s standard input and output. You can then pass these file descriptors toGLib.IOChannel.unix_new()to pass messages back and forth between your processes.Another way is to use DBus, but that’s more complicated and less documented.