We're hiring!
*

CEF on Wayland upstreamed

Santosh Mahto avatar

Santosh Mahto
May 08, 2019

Share this post:

Reading time:

CEF (Chromium Embedded Framework) provides a simple framework for embedded browser/web functionality in your application. It is built on top of Chromium and mitigates the issue of a fast-changing Chromium API with stable APIs.

Over the past few years, Collabora has been involved in a number of customer projects to port/embed CEF on their platforms. One of the major projects related to this was to port CEF on Wayland.

To give some background (see previous blog), Chromium supports multiple backends with its Ozone layer abstraction. Once Chromium is built with Ozone enabled, a specific backend (e.g Wayland, Headless, X11) can be chosen at runtime.

Some time ago, Chromium made the decision to move to a servicification of UI-related components and introduced Mus (mandoline UI service). Ozone was only functional with the Mus framework, and not with the default Aura framework.

The work therefore involved updating CEF to use Mus and use Ozone-enabled Chromium for Wayland support. After quite a bit of effort, with several Collaborans participating, patches were made available for CEF to enable its usage on Wayland. And as our goal was always to upstream these changes to CEF, we began making these patches upstream ready.

However, at that time, building mainline CEF for Wayland still required external patches to be available on the ozone-wayland-dev project. This caused some issues for the patches getting accepted by upstream.

But time passed and the Chromium project changed its mind and deprecated Mus, moving back to its original architecture which allowed Ozone to be functional with the default Aura framework. This simplified everything, and enabled the Chromium main tree to be directly built for Ozone/Wayland.

This also led to some simplification of the patch for the CEF Ozone build and after a successful team effort, the patch has finally landed upstream!

https://bitbucket.org/chromiumembedded/cef/commits/491253fa0371

Now that the patch is directly available upstream, CEF is ready to be built with different Ozone platforms (Wayland, X11, Headless).

There are still some constraints to use CEF for Ozone due to many parts of the code dependant on X11.

  • CEF Ozone is usable only in views mode (top window is created using window views)
  • cefclient is not available in Ozone build.

The CEF Ozone build binary distribution can be created by passing flag --ozone to make_distrib.py.

Here are build instructions to build/run CEF on Wayland:

$ export GN_DEFINES="use_ozone=true"
$ cd /path/to/chromium/src/cef
$ ./cef_create_projects.sh
$ cd /path/to/chromium/src
$ ninja -C out/Release_GN_x64  cefsimple
$ weston &
$ ./out/Release_GN_x64/cefsimple --use-views --ozone-platform=wayland

Screenshot:

Screenshot of CEF on Wayland

Happy coding!

Comments (2)

  1. Anand Srivastava:
    Jun 18, 2019 at 01:35 PM

    I am not able to build.
    Getting a whole lot of errors.
    ./cef_create_projects.sh tries to patch files which it can only patch for a very old version, when the ozone was not merged.
    And on the latest the merge does not happen and compile cannot work.

    Reply to this comment

    Reply to this comment

    1. santosh:
      Jun 18, 2019 at 02:29 PM

      @ Anand : Could you paste error you are getting, I doubt error might have different reason, since patch is applied in chromium source tree and ozone related changes are in CEF, so ozone related changes should not effect patch apply. Just a hint, is your chromium tree on correct revision as specified in cef/CHROMIUM_BUILD_COMPATIBILITY.txt and gclient syned ?

      Reply to this comment

      Reply to this comment


Add a Comment






Allowed tags: <b><i><br>Add a new comment:


Search the newsroom

Latest Blog Posts

Mesa CI and the power of pre-merge testing

08/10/2024

Having multiple developers work on pre-merge testing distributes the process and ensures that every contribution is rigorously tested before…

A shifty tale about unit testing with Maxwell, NVK's backend compiler

15/08/2024

After rigorous debugging, a new unit testing framework was added to the backend compiler for NVK. This is a walkthrough of the steps taken…

A journey towards reliable testing in the Linux Kernel

01/08/2024

We're reflecting on the steps taken as we continually seek to improve Linux kernel integration. This will include more detail about the…

Building a Board Farm for Embedded World

27/06/2024

With each board running a mainline-first Linux software stack and tested in a CI loop with the LAVA test framework, the Farm showcased Collabora's…

Smart audio filters with WirePlumber 0.5

26/06/2024

WirePlumber 0.5 arrived recently with many new and essential features including the Smart Filter Policy, enabling audio filters to automatically…

The latest on cmtp-responder, a permissively-licensed MTP responder implementation

12/06/2024

Part 3 of the cmtp-responder series with a focus on USB gadgets explores several new elements including a unified build environment with…

Open Since 2005 logo

Our website only uses a strictly necessary session cookie provided by our CMS system. To find out more please follow this link.

Collabora Limited © 2005-2024. All rights reserved. Privacy Notice. Sitemap.