Go to file
Pekka Paalanen 823580e070 backend-headless: fully release pango and fontconfig
In the color-icc-output test, this fixes the following ASan reports:

Direct leak of 6912 byte(s) in 27 object(s) allocated from:
    #0 0x7f36bf0a9e8f in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x7f36bd9c2704  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x20704)
    #2 0x7f36bd9c2dc8  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x20dc8)
    #3 0x7f36bd9c439c  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2239c)
    #4 0x7f36bd9cb24c  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2924c)
    #5 0x7f36bd29c4a9  (/lib/x86_64-linux-gnu/libexpat.so.1+0xc4a9)
    #6 0x7f36bd29ada7  (/lib/x86_64-linux-gnu/libexpat.so.1+0xada7)
    #7 0x7f36bd29ba59  (/lib/x86_64-linux-gnu/libexpat.so.1+0xba59)
    #8 0x7f36bd29f8b0 in XML_ParseBuffer (/lib/x86_64-linux-gnu/libexpat.so.1+0xf8b0)
    #9 0x7f36bd9c9152  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27152)
    #10 0x7f36bd9c956b  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2756b)
    #11 0x7f36bd9c977c  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2777c)
    #12 0x7f36bd9c9c9e  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27c9e)
    #13 0x7f36bd29c4a9  (/lib/x86_64-linux-gnu/libexpat.so.1+0xc4a9)
    #14 0x7f36bd29ada7  (/lib/x86_64-linux-gnu/libexpat.so.1+0xada7)
    #15 0x7f36bd29ba59  (/lib/x86_64-linux-gnu/libexpat.so.1+0xba59)
    #16 0x7f36bd29f8b0 in XML_ParseBuffer (/lib/x86_64-linux-gnu/libexpat.so.1+0xf8b0)
    #17 0x7f36bd9c9152  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27152)
    #18 0x7f36bd9c956b  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2756b)
    #19 0x7f36bd9bb507  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x19507)
    #20 0x7f36bd9bb766  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x19766)
    #21 0x7f36bd9ad926  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0xb926)
    #22 0x7f36bd9af8c6 in FcConfigSubstituteWithPat (/lib/x86_64-linux-gnu/libfontconfig.so.1+0xd8c6)
    #23 0x7f36ba21caae  (/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0+0xbaae)
    #24 0x7f36b9b8a6df  (/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0+0xc6df)
    #25 0x7f36b9b88bd9  (/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0+0xabd9)
    #26 0x7f36b9db218d  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2418d)
    #27 0x7f36b9db313b  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2513b)
    #28 0x7f36b9db39aa  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x259aa)
    #29 0x7f36b9db84c8  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2a4c8)
    #30 0x7f36b9db8702 in pango_layout_get_pixel_extents (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2a702)
    #31 0x7f36ba05fbb3 in theme_render_frame ../../git/weston/shared/cairo-util.c:586
    #32 0x7f36ba06c7b7 in frame_repaint ../../git/weston/shared/frame.c:1071
    #33 0x7f36ba07191b in weston_gl_borders_update ../../git/weston/libweston/gl-borders.c:81
    #34 0x7f36ba0544c3 in headless_output_update_gl_border ../../git/weston/libweston/backend-headless/headless.c:150
    #35 0x7f36ba0545a3 in headless_output_repaint ../../git/weston/libweston/backend-headless/headless.c:165
    #36 0x7f36bea58238 in weston_output_repaint ../../git/weston/libweston/compositor.c:3115
    #37 0x7f36bea5921d in weston_output_maybe_repaint ../../git/weston/libweston/compositor.c:3186
    #38 0x7f36bea5a100 in output_repaint_timer_handler ../../git/weston/libweston/compositor.c:3267
    #39 0x7f36beee6766 in wl_timer_heap_dispatch ../../git/wayland/src/event-loop.c:526
    #40 0x7f36beee6766 in wl_event_loop_dispatch ../../git/wayland/src/event-loop.c:1020
    #41 0x7f36beee41d4 in wl_display_run ../../git/wayland/src/wayland-server.c:1431
    #42 0x7f36bfaa3dc3 in wet_main ../../git/weston/compositor/main.c:4080
    #43 0x557d4f1e1703 in execute_compositor ../../git/weston/tests/weston-test-fixture-compositor.c:410
    #44 0x557d4f1ebd43 in weston_test_harness_execute_as_client ../../git/weston/tests/weston-test-runner.c:534
    #45 0x557d4f1c8568 in fixture_setup ../../git/weston/tests/color-icc-output-test.c:462
    #46 0x557d4f1c861f in fixture_setup_run_ ../../git/weston/tests/color-icc-output-test.c:464
    #47 0x557d4f1ec92e in main ../../git/weston/tests/weston-test-runner.c:682
    #48 0x7f36bda4ed09 in __libc_start_main ../csu/libc-start.c:308
    #49 0x557d4f1c5a89 in _start (/home/pq/build/weston-meson/tests/test-color-icc-output+0x3da89)

Indirect leak of 1696 byte(s) in 53 object(s) allocated from:
    #0 0x7f36bf0aa037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0x7f36bd9c2d48  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x20d48)
    #2 0x7f36bd9c439c  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2239c)
    #3 0x7f36bd9cb24c  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2924c)
    #4 0x7f36bd29c4a9  (/lib/x86_64-linux-gnu/libexpat.so.1+0xc4a9)
    #5 0x7f36bd29ada7  (/lib/x86_64-linux-gnu/libexpat.so.1+0xada7)
    #6 0x7f36bd29ba59  (/lib/x86_64-linux-gnu/libexpat.so.1+0xba59)
    #7 0x7f36bd29f8b0 in XML_ParseBuffer (/lib/x86_64-linux-gnu/libexpat.so.1+0xf8b0)
    #8 0x7f36bd9c9152  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27152)
    #9 0x7f36bd9c956b  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2756b)
    #10 0x7f36bd9c977c  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2777c)
    #11 0x7f36bd9c9c9e  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27c9e)
    #12 0x7f36bd29c4a9  (/lib/x86_64-linux-gnu/libexpat.so.1+0xc4a9)
    #13 0x7f36bd29ada7  (/lib/x86_64-linux-gnu/libexpat.so.1+0xada7)
    #14 0x7f36bd29ba59  (/lib/x86_64-linux-gnu/libexpat.so.1+0xba59)
    #15 0x7f36bd29f8b0 in XML_ParseBuffer (/lib/x86_64-linux-gnu/libexpat.so.1+0xf8b0)
    #16 0x7f36bd9c9152  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27152)
    #17 0x7f36bd9c956b  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2756b)
    #18 0x7f36bd9bb507  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x19507)
    #19 0x7f36bd9bb766  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x19766)
    #20 0x7f36bd9ad926  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0xb926)
    #21 0x7f36bd9af8c6 in FcConfigSubstituteWithPat (/lib/x86_64-linux-gnu/libfontconfig.so.1+0xd8c6)
    #22 0x7f36ba21caae  (/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0+0xbaae)
    #23 0x7f36b9b8a6df  (/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0+0xc6df)
    #24 0x7f36b9b88bd9  (/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0+0xabd9)
    #25 0x7f36b9db218d  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2418d)
    #26 0x7f36b9db313b  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2513b)
    #27 0x7f36b9db39aa  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x259aa)
    #28 0x7f36b9db84c8  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2a4c8)
    #29 0x7f36b9db8702 in pango_layout_get_pixel_extents (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2a702)
    #30 0x7f36ba05fbb3 in theme_render_frame ../../git/weston/shared/cairo-util.c:586
    #31 0x7f36ba06c7b7 in frame_repaint ../../git/weston/shared/frame.c:1071
    #32 0x7f36ba07191b in weston_gl_borders_update ../../git/weston/libweston/gl-borders.c:81
    #33 0x7f36ba0544c3 in headless_output_update_gl_border ../../git/weston/libweston/backend-headless/headless.c:150
    #34 0x7f36ba0545a3 in headless_output_repaint ../../git/weston/libweston/backend-headless/headless.c:165
    #35 0x7f36bea58238 in weston_output_repaint ../../git/weston/libweston/compositor.c:3115
    #36 0x7f36bea5921d in weston_output_maybe_repaint ../../git/weston/libweston/compositor.c:3186
    #37 0x7f36bea5a100 in output_repaint_timer_handler ../../git/weston/libweston/compositor.c:3267
    #38 0x7f36beee6766 in wl_timer_heap_dispatch ../../git/wayland/src/event-loop.c:526
    #39 0x7f36beee6766 in wl_event_loop_dispatch ../../git/wayland/src/event-loop.c:1020
    #40 0x7f36beee41d4 in wl_display_run ../../git/wayland/src/wayland-server.c:1431
    #41 0x7f36bfaa3dc3 in wet_main ../../git/weston/compositor/main.c:4080
    #42 0x557d4f1e1703 in execute_compositor ../../git/weston/tests/weston-test-fixture-compositor.c:410
    #43 0x557d4f1ebd43 in weston_test_harness_execute_as_client ../../git/weston/tests/weston-test-runner.c:534
    #44 0x557d4f1c8568 in fixture_setup ../../git/weston/tests/color-icc-output-test.c:462
    #45 0x557d4f1c861f in fixture_setup_run_ ../../git/weston/tests/color-icc-output-test.c:464
    #46 0x557d4f1ec92e in main ../../git/weston/tests/weston-test-runner.c:682
    #47 0x7f36bda4ed09 in __libc_start_main ../csu/libc-start.c:308
    #48 0x557d4f1c5a89 in _start (/home/pq/build/weston-meson/tests/test-color-icc-output+0x3da89)

Indirect leak of 537 byte(s) in 52 object(s) allocated from:
    #0 0x7f36bf057817 in __interceptor_strdup ../../../../src/libsanitizer/asan/asan_interceptors.cpp:452
    #1 0x7f36bd9c1fa4 in FcValueSave (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1ffa4)
    #2 0x7f36bd9c2d5d  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x20d5d)
    #3 0x7f36bd9c439c  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2239c)
    #4 0x7f36bd9cb24c  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2924c)
    #5 0x7f36bd29c4a9  (/lib/x86_64-linux-gnu/libexpat.so.1+0xc4a9)
    #6 0x7f36bd29ada7  (/lib/x86_64-linux-gnu/libexpat.so.1+0xada7)
    #7 0x7f36bd29ba59  (/lib/x86_64-linux-gnu/libexpat.so.1+0xba59)
    #8 0x7f36bd29f8b0 in XML_ParseBuffer (/lib/x86_64-linux-gnu/libexpat.so.1+0xf8b0)
    #9 0x7f36bd9c9152  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27152)
    #10 0x7f36bd9c956b  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2756b)
    #11 0x7f36bd9c977c  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2777c)
    #12 0x7f36bd9c9c9e  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27c9e)
    #13 0x7f36bd29c4a9  (/lib/x86_64-linux-gnu/libexpat.so.1+0xc4a9)
    #14 0x7f36bd29ada7  (/lib/x86_64-linux-gnu/libexpat.so.1+0xada7)
    #15 0x7f36bd29ba59  (/lib/x86_64-linux-gnu/libexpat.so.1+0xba59)
    #16 0x7f36bd29f8b0 in XML_ParseBuffer (/lib/x86_64-linux-gnu/libexpat.so.1+0xf8b0)
    #17 0x7f36bd9c9152  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27152)
    #18 0x7f36bd9c956b  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2756b)
    #19 0x7f36bd9bb507  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x19507)
    #20 0x7f36bd9bb766  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x19766)
    #21 0x7f36bd9ad926  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0xb926)
    #22 0x7f36bd9af8c6 in FcConfigSubstituteWithPat (/lib/x86_64-linux-gnu/libfontconfig.so.1+0xd8c6)
    #23 0x7f36ba21caae  (/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0+0xbaae)
    #24 0x7f36b9b8a6df  (/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0+0xc6df)
    #25 0x7f36b9b88bd9  (/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0+0xabd9)
    #26 0x7f36b9db218d  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2418d)
    #27 0x7f36b9db313b  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2513b)
    #28 0x7f36b9db39aa  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x259aa)
    #29 0x7f36b9db84c8  (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2a4c8)
    #30 0x7f36b9db8702 in pango_layout_get_pixel_extents (/lib/x86_64-linux-gnu/libpango-1.0.so.0+0x2a702)
    #31 0x7f36ba05fbb3 in theme_render_frame ../../git/weston/shared/cairo-util.c:586
    #32 0x7f36ba06c7b7 in frame_repaint ../../git/weston/shared/frame.c:1071
    #33 0x7f36ba07191b in weston_gl_borders_update ../../git/weston/libweston/gl-borders.c:81
    #34 0x7f36ba0544c3 in headless_output_update_gl_border ../../git/weston/libweston/backend-headless/headless.c:150
    #35 0x7f36ba0545a3 in headless_output_repaint ../../git/weston/libweston/backend-headless/headless.c:165
    #36 0x7f36bea58238 in weston_output_repaint ../../git/weston/libweston/compositor.c:3115
    #37 0x7f36bea5921d in weston_output_maybe_repaint ../../git/weston/libweston/compositor.c:3186
    #38 0x7f36bea5a100 in output_repaint_timer_handler ../../git/weston/libweston/compositor.c:3267
    #39 0x7f36beee6766 in wl_timer_heap_dispatch ../../git/wayland/src/event-loop.c:526
    #40 0x7f36beee6766 in wl_event_loop_dispatch ../../git/wayland/src/event-loop.c:1020
    #41 0x7f36beee41d4 in wl_display_run ../../git/wayland/src/wayland-server.c:1431
    #42 0x7f36bfaa3dc3 in wet_main ../../git/weston/compositor/main.c:4080
    #43 0x557d4f1e1703 in execute_compositor ../../git/weston/tests/weston-test-fixture-compositor.c:410
    #44 0x557d4f1ebd43 in weston_test_harness_execute_as_client ../../git/weston/tests/weston-test-runner.c:534
    #45 0x557d4f1c8568 in fixture_setup ../../git/weston/tests/color-icc-output-test.c:462
    #46 0x557d4f1c861f in fixture_setup_run_ ../../git/weston/tests/color-icc-output-test.c:464
    #47 0x557d4f1ec92e in main ../../git/weston/tests/weston-test-runner.c:682
    #48 0x7f36bda4ed09 in __libc_start_main ../csu/libc-start.c:308
    #49 0x557d4f1c5a89 in _start (/home/pq/build/weston-meson/tests/test-color-icc-output+0x3da89)

SUMMARY: AddressSanitizer: 9145 byte(s) leaked in 132 allocation(s).

We do the clean-up unconditionally because xwayland plugin may also need
it, but cannot easily do it itself. This reduces reported leaks in
xwayland test too.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2023-04-12 12:34:58 +00:00
.gitlab-ci gitlab-ci.yml: Bump wayland-protocols to 1.31 2023-03-31 10:08:36 +00:00
clients client-shm: Add basic keyboard support 2023-04-12 14:40:38 +03:00
compositor compositor: free renderer string 2023-04-11 17:48:15 +03:00
data Optimize PNGs with zopflipng 2019-03-28 10:09:52 +00:00
desktop-shell desktop-shell: Do not attempt to change the state 2023-04-11 11:26:24 +00:00
doc frontend: Add common --renderer=foo argument 2023-01-10 10:59:04 +02:00
fullscreen-shell libweston: Use weston_coord in surface committed handler 2023-02-24 18:44:19 +00:00
include input: Consistently use enums for modifier/axis/state 2023-04-03 20:58:06 +03:00
ivi-shell ivi-shell: handle subsurfaces for mouse/touch activation 2023-03-14 13:29:30 +02:00
kiosk-shell libweston: Use weston_coord in struct weston_view 2023-02-24 18:44:19 +00:00
libweston backend-headless: fully release pango and fontconfig 2023-04-12 12:34:58 +00:00
man backend-drm: allow more formats with pixman-renderer 2023-01-31 15:32:24 +00:00
pam libweston: Add user authentication support via PAM 2022-11-23 16:58:48 +01:00
pipewire pipewire-plugin: Check virtual outputs/remoting instance 2023-02-20 12:42:50 +02:00
protocol clients/simple-egl: Implement fractional-scale protocol support 2023-03-31 10:08:36 +00:00
remoting remoting-plugin: Check virtual outputs/remoting instance 2023-02-20 12:41:03 +02:00
shared clients: Add support for tablet cursor motion to window frames in libtoytoolkit 2023-03-31 12:10:26 +00:00
subprojects backend-vnc: add meson wrap files for aml and neatvnc 2023-01-31 09:43:41 +02:00
tests tests: Allow DRM fixture setup to cleanly skip 2023-04-12 10:52:57 +00:00
tools zuc: Delete support for forking tests 2022-07-05 10:15:49 +01:00
wcap build: simplify include_directories 2019-10-04 17:14:22 +03:00
xwayland xwm: Add support for xwayland_shell_v1 2023-03-03 08:21:24 +00:00
.editorconfig Fix .editorconfig: use tabs for Meson files 2019-02-18 11:21:07 +01:00
.gitignore gitignore: Ignore the build/ directory. 2021-07-06 18:46:09 +00:00
.gitlab-ci.yml gitlab-ci.yml: Bump wayland-protocols to 1.31 2023-03-31 10:08:36 +00:00
.mailmap Add a .mailmap file 2023-03-25 11:18:10 -05:00
CONTRIBUTING.md README: establish no-malloc-failures policy 2022-07-20 13:07:22 +03:00
COPYING COPYING: Specify origin of the library 2015-06-15 13:04:19 -07:00
DCO-1.1.txt contributing: add copy of DCO 2019-07-16 11:43:57 +00:00
meson.build libinput: hook up tablet events 2023-03-31 12:10:26 +00:00
meson_options.txt backend-vnc: add VNC support using Neat VNC library 2022-10-18 07:31:42 +02:00
notes.txt notes: fix a typo 2017-01-03 11:59:01 +00:00
README.md frontend: Use short-form names for shell argument 2023-01-10 10:53:02 +02:00
releasing.md releasing: use the Wayland release script 2022-11-10 11:22:54 +02:00
weston.ini.in frontend: Use short-form names for shell argument 2023-01-10 10:53:02 +02:00

Weston

screenshot of skeletal Weston desktop

Weston is a Wayland compositor designed for correctness, reliability, predictability, and performance.

Out of the box, Weston provides a very basic desktop, or a full-featured environment for non-desktop uses such as automotive, embedded, in-flight, industrial, kiosks, set-top boxes and TVs.

It also provides a library called libweston which allows users to build their own custom full-featured environments on top of Weston's core.

Building Weston

Weston is built using Meson. Weston often depends on the current release versions of Wayland and wayland-protocols.

If necessary, the latest Meson can be installed as a user with:

$ pip3 install --user meson

Weston's Meson build does not do autodetection and it defaults to all features enabled, which means you likely hit missing dependencies on the first try. If a dependency is avoidable through a build option, the error message should tell you what option can be used to avoid it. You may need to disable several features if you want to avoid certain dependencies.

$ git clone https://gitlab.freedesktop.org/wayland/weston.git
$ cd weston
$ meson build/ --prefix=...
$ ninja -C build/ install
$ cd ..

The meson command populates the build directory. This step can fail due to missing dependencies. Any build options you want can be added on that line, e.g. meson build/ --prefix=... -Ddemo-clients=false. All the build options can be found in the file meson_options.txt.

Once the build directory has been successfully populated, you can inspect the configuration with meson configure build/. If you need to change an option, you can do e.g. meson configure build/ -Ddemo-clients=false.

Every push to the Weston master repository and its forks is built using GitLab CI. Reading the configuration may provide a useful example of how to build and install Weston.

More detailed documentation on building Weston is available on the Wayland site. There are also more details on how to run and write tests.

For building the documentation see documentation.

Running Weston

Once Weston is installed, most users can simply run it by typing weston. This will launch Weston inside whatever environment you launch it from: when launched from a text console, it will take over that console. When launched from inside an existing Wayland or X11 session, it will start a 'nested' instance of Weston inside a window in that session.

By default, Weston will start with a skeletal desktop-like environment called desktop-shell. Other shells are available; for example, to load the kiosk shell designed for single-application environments, you can start with:

$ weston --shell=kiosk

Help is available by running weston --help, or man weston, which will list the available configuration options and display backends. It can also be configured through a file on disk; more information on this can be found through man weston.ini.

A small suite of example or demo clients are also provided: though they can be useful in themselves, their main purpose is to be an example or test case for others building compositors or clients.

Using libweston

libweston is designed to allow users to use Weston's core - its client support, backends and renderers - whilst implementing their own user interface, policy, configuration, and lifecycle. If you would like to implement your own window manager or desktop environment, we recommend building your project using the libweston API.

Building and installing Weston will also install libweston's shared library and development headers. libweston is both API-compatible and ABI-compatible within a single stable release. It is parallel-installable, so multiple stable releases can be installed and used side by side.

Documentation for libweston's API can be found within the source (see the documentation section), and also on Weston's online documentation for the current stable release.

Reporting issues and contributing

Weston's development is hosted on freedesktop.org GitLab. Please also see the contributing document, which details how to make code or non-technical contributions to Weston.

Weston and libweston are not suitable for severely memory-constrained environments where the compositor is expected to continue running even in the face of trivial memory allocations failing. If standard functions like malloc() fail for small allocations, you can expect libweston to abort. This is only likely to occur if you have disabled your OS's 'overcommit' functionality, and not in common cases.

Documentation

To read the Weston documentation online, head over to the Weston website.

For documenting weston we use sphinx together with breathe to process and augment code documentation from Doxygen. You should be able to install both sphinx and the breathe extension using pip3 command, or your package manager. Doxygen should be available using your distribution package manager.

Once those are set up, run meson with -Ddoc=true option in order to enable building the documentation. Installation will place the documentation in the prefix's path under datadir (i.e., share/doc).

Adding and improving documentation

For re-generating the documentation a special docs target has been added. Although first time you build (and subsequently install) weston, you'll see the documentation being built, updates to the spinx documentation files or to the source files will only be updated when using docs target!

Example:

$ ninja install # generates and installs the documentation
# time passes, hack hack, add doc in sources or rST files
$ ninja install # not sufficient, docs will not be updated
$ ninja docs && ninja install # run 'docs' then install

Improving/adding documentation can be done by modifying rST files under doc/sphinx/ directory or by modifying the source code using doxygen directives.