Search guides and the APICtrl K
  1. API reference
  2. Web editor bridge

webview_gtk.h

The Linux webview backend (GTK3 + WebKitGTK).

#include <sonore/webview_gtk.h>
On this page

Design notes

Mirrors webview_win32.h: a child window the host embeds, a webview inside it, the window.sonore bridge injected before page script, and a ~30 Hz timer pushing parameters and meters into the page.

Linux specifics that shape this file:

  • CLAP's X11 embedding hands us a raw X window id, and GTK plugs into it through gtk_plug_new(). A GtkPlug is the standard XEmbed client: it is what makes the plugin's widgets live inside the host's window rather than floating.
  • WebKitGTK ships as webkit2gtk-4.1 (libsoup3) on current distros and 4.0 (libsoup2) on older ones, and the two CANNOT be loaded into one process together. Rather than link either, everything is resolved with dlopen at runtime, newest first: a plugin binary then runs on both, and a host that already pulled in the other version does not crash us. Linking directly is how a plugin ends up refusing to load on half the distros in the world.
  • Same reason GTK itself is dlopened: hosts vary in what they already have.

When nothing can be loaded the plugin says so instead of showing a blank box.

Types 2

No comment on this one in the header yet; the source says the rest.

A webview inside a GtkPlug, embedded in the host's X11 window.

Same contract as the Win32 backend: create() works immediately, everything else tolerates not being ready, and destroy() is safe at any point.

Functions 2

Aliases 2

Constants 4

↑↓ to move↵ to openEvery public name in the headers, and every guide