WebView for Gtk4, cross-platform (Lin, Win, Mac). CEF or WebKit

WebView for Gtk4, cross-platform (Lin, Win, Mac). Should we put our effort on WebKitGtk or make Chromium/CEF work with Gtk4.

(I know that WebKitGtk is already working for Gtk4, but it is Linux only).

What would be the best path ?

If you want to make WebKitGTK work on Windows, you’re probably going to have to ask the WebKitGTK developers on the webkitgtk mailing list.

Chromium already supports GTK4, as far as I know.

I have for many years tried to ask on the Webkitgtk list about Windows support, but nobody is interested in it, and just talks about DMA-BUF and all the stuff not working on Windows.

Last time I tried Chromium on Windows (using Gtk3) I gave up, since all events where stolen by Chromium and all kinds of hacks was needed to send the signals back to Gtk.

My $0.02: either way is doable, but both will require considerable software development effort. The ongoing maintenance required to keep WebKitGTK working on Windows will surely be more expensive than the initial development. I’m not sure about CEF; maybe once it works for GTK 4, it will just keep working? Either way, good luck.

1 Like

When @mkj mentions Chromium/CEF working with Gtk4 he seemingly means creating a new dedicated GTK/GObject widget that wraps CEF (e.g. CEFGTK), the same way WebKitGTK wraps WebKit. As only then can we try to compare both efforts. There are actually several aspects that should be considered:

  1. Initial effort. What do you think is easier? - To port WebKitGTK to Windows (writing alternative code for some Linux-specific parts there) or to wrap cross-platform CEF with GTK/Gobject? In which of both approaches can AI be utilized more efficiently (which code chunks are more standard/trivial/technocratic and will be easier for AI to generate)?
  2. Long term effort. Which of both cross-platform (Lin, Win, Mac) options will require less maintenance in the long run?
  3. Future proof. Which of both web engines is more dependable? Which gets more contributions from corporations and from the community? Chromium/CEF is kept cross-platform by third parties on all 3 platforms. WebKit targets mainly Mac, Windows support was dropped. What are the chances that Linux support will be dropped one day as well?
  4. Usefulness. Which of both options has more potential impact and thus might enjoy better community support/attract contributions? I wonder what is the motivation of current WebKitGTK developers to maintain it? Do they (or those who subcontract them) use it in their business (providing products/services)? And if yes - would CEFGTK be better or worse alternative for their use cases?

@ebassi , @mcatanzaro (and others) - what are you opinions regarding the above?

https://bitbucket.org/chromiumembedded/cef/annotate/master/tests/cefclient/cefclient_gtk.cc?at=master

@mkj , @ebassi - as per CEF’s author GTK3 and GTK4 are indeed supported in Chromium:

https://source.chromium.org/chromium/chromium/src/+/main:ui/gtk/gtk_compat.cc;l=128?q=kGtkVersion&ss=chromium

One can select the version by passing the --gtk-version=[3|4] command-line flag.

WebKit targets mainly Mac, Windows support was dropped.

WebKit does support Windows, but WebKitGTK does not. Windows is a separate “port” and you have to choose one or the other. It should be possible for motivated developers to change this.

What are the chances that Linux support will be dropped one day as well?

Over a long enough time horizon, who knows. But in the short term, this seems pretty unlikely.

1 Like