• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..16-Feb-2021-

.gitlab-ci/H16-Feb-2021-1710

clients/H16-Feb-2021-41,03632,763

compositor/H16-Feb-2021-7,4535,732

data/H03-May-2022-8672

desktop-shell/H16-Feb-2021-6,5845,048

doc/H03-May-2022-3,4652,620

fullscreen-shell/H16-Feb-2021-957744

include/H16-Feb-2021-3,6592,039

ivi-shell/H16-Feb-2021-6,8624,716

libweston/H16-Feb-2021-50,55035,803

libweston-desktop/H16-Feb-2021-5,8074,633

man/H16-Feb-2021-1,6131,525

pipewire/H16-Feb-2021-926694

protocol/H16-Feb-2021-1,3201,099

remoting/H16-Feb-2021-1,082817

shared/H16-Feb-2021-4,9273,307

tests/H16-Feb-2021-12,9239,003

tools/zunitc/H16-Feb-2021-5,1303,223

wcap/H16-Feb-2021-666493

xwayland/H16-Feb-2021-5,0023,884

.editorconfigH A D16-Feb-2021226 1613

.gitignoreH A D16-Feb-202192 1210

.gitlab-ci.ymlH A D16-Feb-20211.9 KiB8067

CONTRIBUTING.mdH A D16-Feb-202114.9 KiB373279

COPYINGH A D16-Feb-20211.4 KiB3124

README.mdH A D16-Feb-202114.1 KiB363266

meson.buildH A D16-Feb-20215 KiB170147

weston.ini.inH A D16-Feb-20211.8 KiB8873

README.md

1Weston
2======
3
4![screenshot of skeletal Weston desktop](doc/wayland-screenshot.jpg)
5
6Weston is the reference implementation of a Wayland compositor, as well as a
7useful environment in and of itself.
8
9Out of the box, Weston provides a very basic desktop, or a full-featured
10environment for non-desktop uses such as automotive, embedded, in-flight,
11industrial, kiosks, set-top boxes and TVs. It also provides a library allowing
12other projects to build their own full-featured environments on top of Weston's
13core.
14
15The core focus of Weston is correctness and reliability. Weston aims to be lean
16and fast, but more importantly, to be predictable. Whilst Weston does have known
17bugs and shortcomings, we avoid unknown or variable behaviour as much as
18possible, including variable performance such as occasional spikes in frame
19display time.
20
21A small suite of example or demo clients are also provided: though they can be
22useful in themselves, their main purpose is to be an example or test case for
23others building compositors or clients.
24
25If you are after a more mainline desktop experience, the
26[GNOME](https://www.gnome.org) and [KDE](https://www.kde.org) projects provide
27full-featured desktop environments built on the Wayland protocol. Many other
28projects also exist providing Wayland clients and desktop environments: you are
29not limited to just what you can find in Weston.
30
31Reporting issues and contributing
32=================================
33
34Weston's development is
35[hosted on freedesktop.org GitLab](https://gitlab.freedesktop.org/wayland/weston/).
36Please also see [the contributing document](CONTRIBUTING.md), which details how
37to make code or non-technical contributions to Weston.
38
39Building Weston
40===============
41
42Weston is built using [Meson](https://mesonbuild.com/). Weston often depends
43on the current release versions of
44[Wayland](https://gitlab.freedesktop.org/wayland/wayland) and
45[wayland-protocols](https://cgit.freedesktop.org/wayland/wayland-protocols).
46
47If necessary, the latest Meson can be installed as a user with:
48
49	$ pip3 install --user meson
50
51Weston's Meson build does not do autodetection and it defaults to all
52features enabled, which means you likely hit missing dependencies on the first
53try. If a dependency is avoidable through a build option, the error message
54should tell you what option can be used to avoid it. You may need to disable
55several features if you want to avoid certain dependencies.
56
57	$ git clone https://gitlab.freedesktop.org/wayland/weston.git
58	$ cd weston
59	$ meson build/ --prefix=...
60	$ ninja -C build/ install
61	$ cd ..
62
63The `meson` command populates the build directory. This step can
64fail due to missing dependencies. Any build options you want can be added on
65that line, e.g. `meson build/ --prefix=... -Dsimple-dmabuf-drm=intel`.
66All the build options can be found in the file
67[meson_options.txt](meson_options.txt).
68
69Once the build directory has been successfully populated, you can inspect the
70configuration with `meson configure build/`. If you need to change an
71option, you can do e.g.
72`meson configure build/ -Dsimple-dmabuf-drm=intel`.
73
74Every push to the Weston master repository and its forks is built using GitLab
75CI. [Reading the configuration](.gitlab-ci.yml) may provide a useful example of
76how to build and install Weston.
77
78More [detailed documentation on building Weston](https://wayland.freedesktop.org/building.html)
79is available on the Wayland site. There are also more details on
80[how to run and write tests](https://wayland.freedesktop.org/testing.html).
81
82For building the documentation see [weston-doc](#weston-doc).
83
84Running Weston
85==============
86
87Once Weston is installed, most users can simply run it by typing `weston`. This
88will launch Weston inside whatever environment you launch it from: when launched
89from a text console, it will take over that console. When launched from inside
90an existing Wayland or X11 session, it will start a 'nested' instance of Weston
91inside a window in that session.
92
93Help is available by running `weston --help`, or `man weston`, which will list
94the available configuration options and display backends. It can also be
95configured through a file on disk; more information on this can be found through
96`man weston.ini`.
97
98In some special cases, such as when running remotely or without logind's session
99control, Weston may not be able to run directly from a text console. In these
100situations, you can instead execute the `weston-launch` helper, which will gain
101privileged access to input and output devices by running as root, then granting
102access to the main Weston binary running as your user. Running Weston this way
103is not recommended unless necessary.
104
105Weston-doc
106==========
107
108For documenting weston we use [sphinx](http://www.sphinx-doc.org/en/master/)
109together with [breathe](https://breathe.readthedocs.io/en/latest/) that
110understands XMLs databases generated by doxygen. So far, this is a compromise
111until better tools are available in order to remove the doxygen
112dependency. You should be able to install both sphinx and breathe extension
113using pip3 command, or your package manager.
114Doxygen should be available using your distribution package manager.
115
116Once those are set-up, run `meson` with `-Ddoc=true` option in order to enable
117building the documentation. Installation will place the documentation in the
118prefix's path under datadir (i.e., `share/doc`).
119
120Adding and improving documentation
121----------------------------------
122
123For re-generating the documentation a special `docs` target has been added.
124Although first time you build (and subsequently install) weston, you'll see the
125documentation being built, updates to the spinx documentation files or to the
126source files will only be updated when using `docs` target!
127
128Example:
129
130~~~~
131$ ninja install # generates and installs the documentation
132# time passes, hack hack, add doc in sources or rST files
133$ ninja install # not sufficient, docs will not be updated
134$ ninja docs && ninja install # run 'docs' then install
135~~~~
136
137Improving/adding documentation can be done by modifying rST files under
138`doc/sphinx/` directory or by modifying the source code using doxygen
139directives.
140
141Libweston
142=========
143
144Libweston is an effort to separate the re-usable parts of Weston into
145a library. Libweston provides most of the boring and tedious bits of
146correctly implementing core Wayland protocols and interfacing with
147input and output systems, so that people who just want to write a new
148"Wayland window manager" (WM) or a small desktop environment (DE) can
149focus on the WM part.
150
151Libweston was first introduced in Weston 1.12, and is expected to
152continue evolving through many Weston releases before it achieves a
153stable API and feature completeness.
154
155Libweston's primary purpose is exporting an API for creating Wayland
156compositors. Libweston's secondary purpose is to export the weston_config API
157so that third party plugins and helper programs can read `weston.ini` if they
158want to. However, these two scopes are orthogonal and independent. At no point
159will the compositor functionality use or depend on the weston_config
160functionality.
161
162
163API/ABI (in)stability and parallel installability
164-------------------------------------------------
165
166As libweston's API surface is huge, it is impossible to get it right
167in one go. Therefore developers reserve the right to break the API/ABI and bump
168the major version to signify that. For git snapshots of the master branch, the
169API/ABI can break any time without warning.
170
171Libweston major can be bumped only once during a development cycle. This should
172happen on the first patch that breaks the API or ABI. Further breaks before the
173next Weston major.0.0 release do not cause a bump. This means that libweston
174API and ABI are allowed to break also after an alpha release, up to the final
175release. However, breaks after alpha should be judged by the usual practices
176for allowing minor features, fixes only, or critical fixes only.
177
178To make things tolerable for libweston users despite API/ABI breakages,
179different libweston major versions are designed to be perfectly
180parallel-installable. This way external projects can easily depend on a
181particular API/ABI-version. Thus they do not have to fight over which
182ABI-version is installed in a user's system. This allows a user to install many
183different compositors each requiring a different libweston ABI-version without
184tricks or conflicts.
185
186Note, that versions of Weston itself will not be parallel-installable,
187only libweston is.
188
189For more information about parallel installability, see
190http://ometer.com/parallel.html
191
192
193Versioning scheme
194-----------------
195
196In order to provide consistent, easy to use versioning, libweston
197follows the rules in the Apache Portable Runtime Project
198http://apr.apache.org/versioning.html.
199
200The document provides the full details, with the gist summed below:
201 - Major - backward incompatible changes.
202 - Minor - new backward compatible features.
203 - Patch - internal (implementation specific) fixes.
204
205Weston and libweston have separate version numbers in meson.build. All
206releases are made by the Weston version number. Libweston version number
207matches the Weston version number in all releases except maybe pre-releases.
208Pre-releases have the Weston micro version 91 or greater.
209
210A pre-release is allowed to install a libweston version greater than the Weston
211version in case libweston major was bumped. In that case, the libweston version
212must be Weston major + 1.
213
214Pkg-config files are named after libweston major, but carry the Weston version
215number. This means that Weston pre-release 2.1.91 may install libweston-3.pc
216for the future libweston 3.0.0, but the .pc file says the version is still
2172.1.91. When a libweston user wants to depend on the fully stable API and ABI
218of a libweston major, he should use (e.g. for major 3):
219
220	PKG_CHECK_MODULES(LIBWESTON, [libweston-3 >= 3.0.0])
221
222Depending only on libweston-3 without a specific version number still allows
223pre-releases which might have different API or ABI.
224
225
226Forward compatibility
227---------------------
228
229Inspired by ATK, Qt and KDE programs/libraries, libjpeg-turbo, GDK,
230NetworkManager, js17, lz4 and many others, libweston uses a macro to restrict
231the API visible to the developer - REQUIRE_LIBWESTON_API_VERSION.
232
233Note that different projects focus on different aspects - upper and/or lower
234version check, default to visible/hidden old/new symbols and so on.
235
236libweston aims to guard all newly introduced API, in order to prevent subtle
237breaks that a simple recompile (against a newer version) might cause.
238
239The macro is of the format 0x$MAJOR$MINOR and does not include PATCH version.
240As mentioned in the Versioning scheme section, the latter does not reflect any
241user visible API changes, thus should be not considered part of the API version.
242
243All new symbols should be guarded by the macro like the example given below:
244
245~~~~
246#if REQUIRE_LIBWESTON_API_VERSION >= 0x0101
247
248bool
249weston_ham_sandwich(void);
250
251#endif
252~~~~
253
254In order to use the said symbol, the one will have a similar code in their
255configure.ac:
256
257~~~~
258PKG_CHECK_MODULES(LIBWESTON, [libweston-1 >= 1.1])
259AC_DEFINE(REQUIRE_LIBWESTON_API_VERSION, [0x0101])
260~~~~
261
262If the user is _not_ interested in forward compatibility, they can use 0xffff
263or similar high value. Yet doing so is not recommended.
264
265
266Libweston design goals
267----------------------
268
269The high-level goal of libweston is to decouple the compositor from
270the shell implementation (what used to be shell plugins).
271
272Thus, instead of launching 'weston' with various arguments to choose the
273shell, one would launch the shell itself, e.g. 'weston-desktop',
274'weston-ivi', 'orbital', etc. The main executable (the hosting program)
275will implement the shell, while libweston will be used for a fundamental
276compositor implementation.
277
278Libweston is also intended for use by other project developers who want
279to create new "Wayland WMs".
280
281Details:
282
283- All configuration and user interfaces will be outside of libweston.
284  This includes command line parsing, configuration files, and runtime
285  (graphical) UI.
286
287- The hosting program (main executable) will be in full control of all
288  libweston options. Libweston should not have user settable options
289  that would work behind the hosting program's back, except perhaps
290  debugging features and such.
291
292- Signal handling will be outside of libweston.
293
294- Child process execution and management will be outside of libweston.
295
296- The different backends (drm, fbdev, x11, etc) will be an internal
297  detail of libweston. Libweston will not support third party
298  backends. However, hosting programs need to handle
299  backend-specific configuration due to differences in behaviour and
300  available features.
301
302- Renderers will be libweston internal details too, though again the
303  hosting program may affect the choice of renderer if the backend
304  allows, and maybe set renderer-specific options.
305
306- plugin design ???
307
308- xwayland ???
309
310- weston-launch is still with libweston even though it can only launch
311  Weston and nothing else. We would like to allow it to launch any compositor,
312  but since it gives by design root access to input devices and DRM, how can
313  we restrict it to intended programs?
314
315There are still many more details to be decided.
316
317
318For packagers
319-------------
320
321Always build Weston with --with-cairo=image.
322
323The Weston project is (will be) intended to be split into several
324binary packages, each with its own dependencies. The maximal split
325would be roughly like this:
326
327- libweston (minimal dependencies):
328	+ headless backend
329	+ wayland backend
330
331- gl-renderer (depends on GL libs etc.)
332
333- drm-backend (depends on libdrm, libgbm, libudev, libinput, ...)
334
335- x11-backend (depends of X11/xcb libs)
336
337- xwayland (depends on X11/xcb libs)
338
339- fbdev-backend (depends on libudev...)
340
341- rdp-backend (depends on freerdp)
342
343- weston (the executable, not parallel-installable):
344	+ desktop shell
345	+ ivi-shell
346	+ fullscreen shell
347	+ weston-info, weston-terminal, etc. we install by default
348	+ screen-share
349
350- weston demos (not parallel-installable)
351	+ weston-simple-* programs
352	+ possibly all the programs we build but do not install by
353	  default
354
355- and possibly more...
356
357Everything should be parallel-installable across libweston major
358ABI-versions (libweston-1.so, libweston-2.so, etc.), except those
359explicitly mentioned.
360
361Weston's build may not sanely allow this yet, but this is the
362intention.
363