b2f6ff45c2
Variables on the stack are released when the parent block is closed. Here, `now` is used outside of the `if` block, causing the following crash when starting Sway with the headless backend: ==49606==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7fff94645f90 at pc 0x5558aeae9e29 bp 0x7fff94645df0 sp 0x7fff94645de0 READ of size 16 at 0x7fff94645f90 thread T0 #0 0x5558aeae9e28 in handle_present ../sway/desktop/output.c:834 #1 0x7fdc8d6792fb in wlr_signal_emit_safe ../subprojects/wlroots/util/signal.c:29 #2 0x7fdc8d54f77f in wlr_output_send_present ../subprojects/wlroots/types/output/output.c:766 #3 0x7fdc8d524a28 in output_commit ../subprojects/wlroots/backend/headless/output.c:71 #4 0x7fdc8d54d2db in wlr_output_commit ../subprojects/wlroots/types/output/output.c:629 #5 0x5558aeb013cb in output_render ../sway/desktop/render.c:1157 #6 0x5558aeae549e in output_repaint_timer_handler ../sway/desktop/output.c:544 #7 0x5558aeae5f8a in damage_handle_frame ../sway/desktop/output.c:606 #8 0x7fdc8d6792fb in wlr_signal_emit_safe ../subprojects/wlroots/util/signal.c:29 #9 0x7fdc8d6007d5 in output_handle_frame ../subprojects/wlroots/types/wlr_output_damage.c:44 #10 0x7fdc8d6792fb in wlr_signal_emit_safe ../subprojects/wlroots/util/signal.c:29 #11 0x7fdc8d54ee84 in wlr_output_send_frame ../subprojects/wlroots/types/output/output.c:720 #12 0x7fdc8d54efc3 in schedule_frame_handle_idle_timer ../subprojects/wlroots/types/output/output.c:728 #13 0x7fdc8c9dcf5a in wl_event_loop_dispatch_idle (/usr/lib/libwayland-server.so.0+0xaf5a) #14 0x7fdc8c9dcfb4 in wl_event_loop_dispatch (/usr/lib/libwayland-server.so.0+0xafb4) #15 0x7fdc8c9dabc6 in wl_display_run (/usr/lib/libwayland-server.so.0+0x8bc6) #16 0x5558aeac8e30 in server_run ../sway/server.c:285 #17 0x5558aeac3c7d in main ../sway/main.c:396 #18 0x7fdc8be35b24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) #19 0x5558aea8686d in _start (/home/simon/src/sway/build/sway/sway+0x33f86d) |
||
---|---|---|
.builds | ||
backend | ||
docs | ||
examples | ||
include | ||
protocol | ||
render | ||
tinywl | ||
types | ||
util | ||
xcursor | ||
xwayland | ||
.editorconfig | ||
.gitignore | ||
CONTRIBUTING.md | ||
LICENSE | ||
README.md | ||
meson.build | ||
meson_options.txt | ||
wlroots.syms |
README.md
wlroots
Pluggable, composable, unopinionated modules for building a Wayland compositor; or about 60,000 lines of code you were going to write anyway.
- wlroots provides backends that abstract the underlying display and input hardware, including KMS/DRM, libinput, Wayland, X11, and headless backends, plus any custom backends you choose to write, which can all be created or destroyed at runtime and used in concert with each other.
- wlroots provides unopinionated, mostly standalone implementations of many Wayland interfaces, both from wayland.xml and various protocol extensions. We also promote the standardization of portable extensions across many compositors.
- wlroots provides several powerful, standalone, and optional tools that implement components common to many compositors, such as the arrangement of outputs in physical space.
- wlroots provides an Xwayland abstraction that allows you to have excellent Xwayland support without worrying about writing your own X11 window manager on top of writing your compositor.
- wlroots provides a renderer abstraction that simple compositors can use to avoid writing GL code directly, but which steps out of the way when your needs demand custom rendering code.
wlroots implements a huge variety of Wayland compositor features and implements them right, so you can focus on the features that make your compositor unique. By using wlroots, you get high performance, excellent hardware compatibility, broad support for many wayland interfaces, and comfortable development tools - or any subset of these features you like, because all of them work independently of one another and freely compose with anything you want to implement yourself.
Check out our wiki to get started with wlroots. Join our IRC channel: #sway-devel on Libera Chat.
wlroots is developed under the direction of the sway project. A variety of wrapper libraries are available for using it with your favorite programming language.
Building
Install dependencies:
- meson
- wayland
- wayland-protocols
- EGL and GLESv2 (optional, for the GLES2 renderer)
- Vulkan loader, headers and glslang (optional, for the Vulkan renderer)
- libdrm
- GBM
- libinput (optional, for the libinput backend)
- xkbcommon
- udev
- pixman
- libseat
If you choose to enable X11 support:
- xwayland (build-time only, optional at runtime)
- libxcb
- libxcb-render-util
- libxcb-wm
- libxcb-errors (optional, for improved error reporting)
Run these commands:
meson build/
ninja -C build/
Install like so:
sudo ninja -C build/ install
Contributing
See CONTRIBUTING.md.