Skip to content

Create a dedicated channel for constellation -> embedder communication #15934

@paulrouget

Description

@paulrouget

This issue is part of an effort to improve Servo's embedding story. See https://github.com/paulrouget/servoshell/projects/2

Follow up of #15795.

As of now, Servo communicates with the embedder by calling the WindowMethods, in the main thread. These methods are called from the compositor, and the main thread is woken up via the compositor proxy.

A subset of these methods are relevant to the compositor (framebuffer_size(), window_rect(), …) and some are not (set_page_title(), status(), …).

Also, some of these calls need to be synchronous (framebuffer_size()) some don't (set_cursor()).

As Alan noted in #15795:

this seems to be conflating two (at least conceptually) different threads: the compositor, and the embedding application"

So to make the embedding API more sensible (separation of concerns), it would be great to have a dedicated mechanism for the constellation to communicate with the embedder.

This channel should be between the constellation and the embedder.

We would end up with 2 channels between the servo and the embedder: constellation -> embedder and compositor -> embedder. With the embedder code running in the main thread.

Ideally, both channels would follow the same pattern: sync calls would be methods, async calls would be events, and the embedder would provide a mechanism to both channels to wake up the main thread.

We would need to identify in the current WindowMethods what falls under compositor and constellation concerns.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-assignedThere is someone working on resolving the issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions