[webkit-gtk] Custom GTK widgets inside webview

Michael Catanzaro mcatanzaro at igalia.com
Mon Jun 5 03:55:52 PDT 2017


On Mon, Jun 5, 2017 at 5:41 AM, Zisu Andrei <matzipan at gmail.com> wrote:
> I am wondering what makes it unsolvable in your view? Afaict, the 
> button element or text entries and what not are still GTK widgets at 
> the end of the day, so to my ignorant mind it's just a matter of 
> repurposing that code? I will have a better look at the code in 
> question.
> 
> At the moment I am doing the same thing Robert is mentioning on that 
> thread: I'm resizing the webview until it doesn't require scrolling. 
> It was a hacky way to get a prototype and I want to move away from it.
> 
See RenderThemeGtk.cpp and ScrollbarThemeGtk.cpp. You will quickly see 
why repurposing that code is not going to be practical... these are not 
GTK+ widgets in any real sense of those words, they are drawn manually 
and at great effort using the terrible GTK+ foreign drawing API. These 
are just normal DOM widgets styled to look like GTK+ widgets. You're 
looking at a major engineering project touching the internals of 
WebCore if you want to allow real GTK+ widgets into the DOM.

You will have more luck using WebKitGTK+ 2.4 API ("WebKit1") where this 
was supported and everything was in one process, but keep in mind this 
old insecure version of WebKit is being removed from Linux distros and 
is not suitable if your application is ever going to process untrusted 
input.

Good luck,

Michael



More information about the webkit-gtk mailing list