Skip to content

phase-3: HiDPI scale sync between parent + child wl_surface #149

@mxaddict

Description

@mxaddict

Wayland subsurfaces have their own `wl_surface::set_buffer_scale` independent of the parent. When buffr's parent is at scale 2 (HiDPI), the WebKit child must also render at 2x, or the page appears at half-size pixelated.

Scope

  • On `winit::WindowEvent::ScaleFactorChanged`: apps calls existing `engine.set_device_scale(scale)`.
  • Engine propagates to the WebKit toplevel. WPE 2.52 has `wpe_view_set_scale_factor(view, scale: f64)` — verify in bindings.
  • Native path additionally calls `wl_surface::set_buffer_scale(child_surface, scale)` on the WebKit subsurface.

Compositor coordination

The compositor may also use fractional-scale-v1 protocol. If present, prefer that over set_buffer_scale (which is integer only). Detect via wl_registry; bind via `wp_fractional_scale_v1` extension.

Out of scope

  • Per-output scaling (multi-monitor with different DPIs and window straddling) — Wayland handles this via wl_surface enter/leave events on outputs; defer.

Acceptance

  • Open buffr on a HiDPI monitor → WebKit renders at native pixel density.
  • Drag buffr between monitors of different scales → WebKit re-renders at new scale within ~1 frame.

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestparkedDormant — feature kept in backlog but not actively worked on

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions