Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Solved!</strong></p> <p>Through ongoing research, scouring forums and source code repositories, I peiced together the necessary steps to accomplish this using only libwebkit and a standard compiz desktop (any Xorg desktop with compositing should do).</p> <p>For a current libwebkit (1.1.10-SVN), there is an Ubuntu PPA:</p> <pre><code>deb http://ppa.launchpad.net/webkit-team/ppa/ubuntu jaunty main deb-src http://ppa.launchpad.net/webkit-team/ppa/ubuntu jaunty main </code></pre> <p>As far as the code goes, the key is calling <code>webkit_web_view_set_transparent</code>.</p> <p>And of course the system you're running it on should have a capable graphics card (intel, radeon, or nvidia) and be running a compositing window manager (like Compiz).</p> <p>And finally, to actually see transparency, the content you're viewing must set a transparent background using CSS3, otherwise it's still completely opaque.</p> <p>It's as simple as:</p> <pre><code>BODY { background-color: rgba(0,0,0,0); } </code></pre> <p>Here' is the full sample for the simplest possible webkit browser app, with transparency support:</p> <pre><code>#include &lt;gtk/gtk.h&gt; #include &lt;webkit/webkit.h&gt; static void destroy_cb(GtkWidget* widget, gpointer data) { gtk_main_quit(); } int main(int argc, char* argv[]) { gtk_init(&amp;argc, &amp;argv); if(!g_thread_supported()) g_thread_init(NULL); // Create a Window, set colormap to RGBA GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL); GdkScreen *screen = gtk_widget_get_screen(window); GdkColormap *rgba = gdk_screen_get_rgba_colormap (screen); if (rgba &amp;&amp; gdk_screen_is_composited (screen)) { gtk_widget_set_default_colormap(rgba); gtk_widget_set_colormap(GTK_WIDGET(window), rgba); } gtk_window_set_default_size(GTK_WINDOW(window), 800, 800); g_signal_connect(window, "destroy", G_CALLBACK(destroy_cb), NULL); // Optional: for dashboard style borderless windows gtk_window_set_decorated(GTK_WINDOW(window), FALSE); // Create a WebView, set it transparent, add it to the window WebKitWebView* web_view = web_view = WEBKIT_WEB_VIEW(webkit_web_view_new()); webkit_web_view_set_transparent(web_view, TRUE); gtk_container_add (GTK_CONTAINER(window), GTK_WIDGET(web_view)); // Load a default page webkit_web_view_load_uri(web_view, "http://stackoverflow.com/"); // Show it and continue running until the window closes gtk_widget_grab_focus(GTK_WIDGET(web_view)); gtk_widget_show_all(window); gtk_main(); return 0; } </code></pre> <p><a href="http://i27.tinypic.com/2qntlxl.jpg">Screenshot! http://i27.tinypic.com/2qntlxl.jpg</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload