[webkit-gtk] rendering browser on offscreen surface/window

Prasanta Sadhukhan psadhukhan at gmail.com
Wed Aug 8 03:44:22 PDT 2012


On Wed, Aug 8, 2012 at 2:57 PM, Martin Robinson <mrobinson at webkit.org>wrote:

> On Wed, Aug 8, 2012 at 10:48 AM, Prasanta Sadhukhan
> <psadhukhan at gmail.com> wrote:
> > Thanks  for your reply..
> > I am new to gtk+ programming so I probably will miss some code which are
> > obvious to gtk experts.
> > I modified the code to include the offscreen window realizing but still
> it
> > does not display the webpage.
> > Here's the modified code snippet (other code remain same as previous
> mail).
> > I tried different ways (commented out code) but still the webpage is not
> > displayed. Can anyone suggest what else I need to do to display offscreen
> > contents (webpage) in main window?
>
> The code that you have pasted, seems to assume that realization and
> loading happen synchronously, when in reality they happen
> asynchronously. You should probably attach callbacks to the relevant
> signals and only try to get the WebView snapshot afterward. Note, that
> these are just issues that I'm spotting glancing at your code. I can't
> guarantee that things will work after just fixing these problems.
>
> Thanks for the insight...
It seems all the "load" related signals like

 "load-committed
<http://webkitgtk.org/reference/webkitgtk/stable/webkitgtk-webkitwebview.html#WebKitWebView-load-committed>"
                                : Run Last
<http://developer.gnome.org/gobject/stable/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS>
  "load-error <http://webkitgtk.org/reference/webkitgtk/stable/webkitgtk-webkitwebview.html#WebKitWebView-load-error>"
                                    : Run Last
<http://developer.gnome.org/gobject/stable/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS>
  "load-finished
<http://webkitgtk.org/reference/webkitgtk/stable/webkitgtk-webkitwebview.html#WebKitWebView-load-finished>"
                                 : Run Last
<http://developer.gnome.org/gobject/stable/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS>
  "load-progress-changed
<http://webkitgtk.org/reference/webkitgtk/stable/webkitgtk-webkitwebview.html#WebKitWebView-load-progress-changed>"
                         : Run Last
<http://developer.gnome.org/gobject/stable/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS>
  "load-started
<http://webkitgtk.org/reference/webkitgtk/stable/webkitgtk-webkitwebview.html#WebKitWebView-load-started>"

 have been deprecated and urge user to use "load-status" property instead.
Pardon my ignorance, but
should I need to use the function
webkit_web_view_get_load_status ()
to get the "load-status" and only if the return is

WEBKIT_LOAD_FINISHED

I need to do
gtk_offscreen_window_get_pixbuf() and gtk_container_add(main_window,
pixbuf);

Can I ask for some code snippet or example of loading a primitive say a
rectangle/circle on offscreen and then render to primary screen
I guess that will purely use GTK+ apis and not use any webkit apis and
probably will not be as complicated as loading webpage in offscreen.
Please let me know if  this is the right mailing lists for this gtk+
queries too.

Regards
Prasanta

> A lot of the information I'm providing can be found by looking through
> the GTK+ reference documentation and blog posts like these:
>
> * http://blog.yorba.org/jim/2010/10/those-realize-map-widget-signals.html
> *
> http://webkitgtk.org/reference/webkitgtk/stable/webkitgtk-webkitwebview.html#WebKitWebView--load-status
>
> --Martin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-gtk/attachments/20120808/98d2a67d/attachment.html>


More information about the webkit-gtk mailing list