[webkit-gtk] rendering browser on offscreen surface/window
mrobinson at webkit.org
Tue Aug 7 05:04:21 PDT 2012
On Tue, Aug 7, 2012 at 9:20 AM, Prasanta Sadhukhan <psadhukhan at gmail.com> wrote:
> I am trying in this manner as shown below on 1.8.1 webkitgtk but I am
> getting error like below and the webpage is not displayed.
> Can anyone suggest if the above scenario can be achieved OR do we need to
> load the webpage on the main window
After a quick look at your code, it seems that you are not realizing
the offscreen window.
> Also, another question is since gtk_main() is a non returning call, can we
> call it inside a thread as I tried to do below or do we need to call it
> every time we try to load a webpage in load_webpage()?
I don't recommend using WebKit from different threads than the main
thread. Right now there are bugs where soup callbacks do not take the
GDK lock, so loading from some other thread can crash your program.
Additionally it seems that GDK is removing the ability to use it from
other threads entirely (see the recent threads about removing the GDK
thread APIs on the GTK+ mailing list), so fixing these bugs seem much
less important now.
If you *really* need to decouple the browser from the UI thread, the
right approach is to use WebKit2 and to help us finish it. Another
tactic is to look at what is slow during rendering and help us make it
faster. Trying to reimplement WebKit2 via threads with WebKit1 is
probably going to cause a lot of pain for you.
More information about the webkit-gtk