Sub-task of #145 (re-scoped 2026-05-17). Depends on #145a (handles wired through).
Add a new C-side `BuffrDisplayWayland` GObject subclass of `WPEDisplay` to `csrc/wpe_subclasses.c`. Unlike stock `WPEDisplayWayland` (which opens its own wl_display), this subclass uses buffr's existing wl_display passed in at construction. Solves the cross-client subsurface problem.
Scope
```c
struct _BuffrDisplayWayland {
WPEDisplay parent_instance;
struct wl_display *wl_display;
struct wl_compositor *wl_compositor;
struct wl_subcompositor *wl_subcompositor;
struct wl_surface *parent_surface;
EGLDisplay egl_display;
};
BuffrDisplayWayland *buffr_display_wayland_new(
struct wl_display *,
struct wl_compositor *,
struct wl_subcompositor *,
struct wl_surface *parent,
EGLDisplay
);
```
vmethods to override:
- `get_egl_display` → returns `self->egl_display`.
- `get_keymap`, `get_screen` — can probably forward to a stub or replicate BuffrDisplay's behavior.
- `create_view` → creates a `BuffrViewWayland` (#145c) with the same wl_*/EGL handles.
- `connect` → no-op (we don't own the connection).
Reference impls
- `csrc/wpe_subclasses.c::BuffrDisplay` — our existing OSR subclass. Mirror the structure (type registration via `g_type_register_static_simple`, vmethod table).
- `/usr/include/wpe-webkit-2.0/wpe-platform/wpe/wpe-platform.h` — WPEDisplay base class API.
Rust shim
- Add `buffr_display_wayland_new` to the extern declarations in `crates/buffr-webkit/src/platform/wpe_subclass.rs`.
- Add a Rust constructor `BuffrDisplayWaylandHandle::new(...)` that calls the C function + wraps the pointer.
- Add a new `WpeDisplayKind::BuffrWayland(BuffrDisplayWaylandHandle)` variant. The current `Wayland` variant (stock WPEDisplayWayland) will be removed or kept as a fallback.
Out of scope
- The view subclass itself (#145c).
- Any rendering (#145c handles that).
Acceptance
- WebKitWebView can be constructed against a BuffrDisplayWayland — no errors.
- create_view callback fires; we receive a BuffrViewWayland (still stubbed for rendering).
Reference
Sub-task of #145 (re-scoped 2026-05-17). Depends on #145a (handles wired through).
Add a new C-side `BuffrDisplayWayland` GObject subclass of `WPEDisplay` to `csrc/wpe_subclasses.c`. Unlike stock `WPEDisplayWayland` (which opens its own wl_display), this subclass uses buffr's existing wl_display passed in at construction. Solves the cross-client subsurface problem.
Scope
```c
struct _BuffrDisplayWayland {
WPEDisplay parent_instance;
struct wl_display *wl_display;
struct wl_compositor *wl_compositor;
struct wl_subcompositor *wl_subcompositor;
struct wl_surface *parent_surface;
EGLDisplay egl_display;
};
BuffrDisplayWayland *buffr_display_wayland_new(
struct wl_display *,
struct wl_compositor *,
struct wl_subcompositor *,
struct wl_surface *parent,
EGLDisplay
);
```
vmethods to override:
Reference impls
Rust shim
Out of scope
Acceptance
Reference