aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-11-08text-input: fix type of send_preedit_string() argsIsaac Freund
The protocol uses a signed integer here, which is also what the wlr_input_method_v2_preedit_string struct provides to compositors from the input method protocol. Sway currently just passes those int32_t values directly to this function leading to an implicit conversion.
2021-11-08output: drop wlr_output_export_dmabufSimon Ser
Callers can access output->front_buffer instead.
2021-11-08screencopy-v1: stop using wlr_output_export_dmabufSimon Ser
2021-11-08export-dmabuf-v1: stop using wlr_output_export_dmabufSimon Ser
2021-11-07text-input/input-method: handle strdup() failureIsaac Freund
2021-11-07scene: fix calloc size mismatchSimon Ser
2021-11-06CONTRIBUTING.md: add CoC sectionKirill Primak
2021-11-06output: fix leak of wlr_drm_formatIsaac Freund
2021-11-02backend/drm: handle per-connector hotplug eventsSimon Ser
When a connector ID is specified in a hotplug event, don't scan all connectors. Only scan the connector that has changed.
2021-11-02backend/session: introduce wlr_device_change_eventSimon Ser
This struct contains additional information for session device change events, such as the DRM connector ID that has changed.
2021-11-02xwayland: add support for -noTouchPointerEmulationSimon Ser
This allows compositors to handle touch pointer emulation manually, instead of having Xwayland do it [1]. [1]: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/691
2021-11-02render: completely disable gles2 if requested but libEGL is foundJan Beich
For `required` to disable search the value needs to be of `feature` type. Checking `gles2` via `in` keyword returns a `bool` but `required: false` makes the dependency optional instead of disabled.
2021-11-01s/GitHub/GitLab/Simon Ser
2021-11-01ci: add .gitlab-ci.ymlSimon Ser
This is a glue file to allow integration with builds.sr.ht.
2021-10-31scene/subsurface_tree: hide unmapped subsurfacestiosgz
2021-10-31backend/wayland: use xdga client activationRonan Pigott
2021-10-31xdg-activation-v1: add data field and emit token destroy eventsRonan Pigott
The data field is useful to track metadata about a token. The destroy events are useful for compositors that track application startup to let them know they can stop doing that.
2021-10-31xdg-activation-v1: enable compositors to request their own tokensRonan Pigott
These new functions allow a compositor to request new managed tokens without participating in the xdg-activation procedure as a wayland client. This enables the compositor itself to behave as a launcher application.
2021-10-29backend/drm: avoid creating empty FB_DAMAGE_CLIPS propSimon Ser
drmModeCreatePropertyBlob cannot create zero-sized blobs, that fails with EINVAL. Closes: https://github.com/swaywm/wlroots/issues/3297
2021-10-29output: fix stack variable lifetime in wlr_output_send_presentSimon Ser
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)
2021-10-29backend/drm: get rid of BO handle tableSimon Ser
The BO handle table exists to avoid double-closing a BO handle, which aren't reference-counted by the kernel. But if we can guarantee that there is only ever a single ref for each BO handle, then we don't need the BO handle table anymore. This is possible if we create the handle right before the ADDFB2 IOCTL, and close the handle right after. The handles are very short-lived and we don't need to track their lifetime. Because of multi-planar FBs, we need to be a bit careful: some FB planes might share the same handle. But with a small check, it's easy to avoid double-closing the same handle (which wouldn't be a big deal anyways). There's one gotcha though: drmModeSetCursor2 takes a BO handle as input. Saving the handles until drmModeSetCursor2 time would require us to track BO handle lifetimes, so we wouldn't be able to get rid of the BO handle table. As a workaround, use drmModeGetFB to turn the FB ID back to a BO handle, call drmModeSetCursor2 and then immediately close the BO handle. The overhead should be minimal since these IOCTLs are pretty cheap. Closes: https://github.com/swaywm/wlroots/issues/3164
2021-10-29sceeencopy-v1: listen to output destroy in capture_outputSimon Ser
If the output is destroyed after capture_output but before frame_handle_copy, it'll have a dangling output pointer. Add the output destroy listener in capture_output. Closes: https://github.com/swaywm/wlroots/issues/3284
2021-10-27scene: inline subsurface_tree_destroySimon Ser
This is only called from one function. To destroy the wlr_scene_subsurface_tree from elsewhere, callers can destroy the scene-graph node returned by wlr_scene_subsurface_tree_create instead (just like a compositor would do). subsurface_tree_handle_surface_destroy does exactly this. Inlining avoids calling subsurface_tree_destroy by mistake.
2021-10-27backend/drm/legacy.c: Fix memory leak in drm_legacy_crtc_set_gammaHaelwenn (lanodan) Monnier
Found via scan-build
2021-10-27render/egl.c: Fix memory leaks in egl_createHaelwenn (lanodan) Monnier
calloc is moved to right before egl is called to avoid requiring to free() unused memory. Found via scan-build
2021-10-27render/pixman/renderer.c: Fix memory-leak in create_bufferHaelwenn (lanodan) Monnier
Found via scan-build
2021-10-27backend.c: do not try to explicitly clean up the libinput backendMarkusVolk
Since libinput is an optional dependency the libinput backend is possibly undeclared. wlr_backend_destroy(backend) below will clean up the child libinput backend if any.
2021-10-27backend/x11: fix code style in get_touchpoint_from_x11_touch_idSimon Ser
2021-10-26backend/drm: add entry for Valve EDID vendorSimon Ser
As found in e.g. the Steam Deck.
2021-10-26readme: refresh dependenciesSimon Ser
2021-10-26output: refuse to enable with zero modeSimon Ser
This can happen if the compositor enables an output without picking a mode, or performs a modeset with a zero width/height.
2021-10-25xdg-foreign-v2: use error enumSimon Ser
A wayland-protocols patch [1] has added error codes for invalid surfaces. [1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/57 Closes: https://github.com/swaywm/wlroots/issues/2600
2021-10-23output: split into multiple filesSimon Ser
This organizes the wlr_output implementation into separate files. This avoids having a single mega-file with lots of unrelated parts and makes it more obvious what the interactions between all the parts are. No functional changes, just moving code around.
2021-10-23scene: add support for direct scan-outSimon Ser
Check if only a single node intersects with the output viewport and all of its properties match. In this case, attempt direct scan-out.
2021-10-22scene: add wlr_scene_output_for_each_surfaceSimon Ser
This allows compositors to more easily implement sending wl_surface.frame callback done events.
2021-10-22backend/multi: implement get_buffer_capsSimon Zeni
2021-10-22presentation-time: remove unused fieldSimon Ser
2021-10-22presentation-time: use a surface addonKirill Primak
2021-10-21Update loc count in readmebuffet
2021-10-19render/vulkan: check vulkan-headers dependencySimon Ser
There's no pkg-config file we can check for sadly, so check vulkan/vulkan.h as a fallback. Closes: https://github.com/swaywm/wlroots/issues/3272
2021-10-18scene: remove surface commit listener when node is destroyedSimon Ser
2021-10-18render/vulkan: Use image view swizzles instead of shader hackJoshua Ashton
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-10-18Add error handling to backend creationAnthony Super
This commit adds two error-handling cases to the function attempt_dmr_backend. Specifically: - In the case where the number of found GPUs is zero, we now print a log message indicating this and return a NULL pointer - In the case where we could not successfully create a backend on any GPU, we now log a message indicating this and return a NULL pointer This allows us to provide more descriptive error messages, as well as avoid a SEGFAULT (the function `ensure_primary_backend_renderer_and_allocator` dereferences the pointer given, which could be NULL until this patch) when these cases arise.
2021-10-18render/vulkan: add Vulkan renderernyorain
This new renderer is implemented with the existing wlr_renderer API (which is known to be sub-optimal for some operations). It's not used by default, but users can opt-in by setting WLR_RENDERER=vulkan. The renderer depends on VK_EXT_image_drm_format_modifier and VK_EXT_physical_device_drm. Co-authored-by: Simon Ser <contact@emersion.fr> Co-authored-by: Jan Beich <jbeich@FreeBSD.org>
2021-10-15presentation-time: don't send presented on discardKirill Primak
2021-10-15output: add presented flag to presentation eventKirill Primak
2021-10-15output: disallow NULL event for wlr_output_send_present()Kirill Primak
2021-10-14render/allocator: use empty DRM lease to re-open nodeSimon Ser
This allows us to obtain a new DRM file description without relying on filesystem permissions.
2021-10-14scene: add functions to place node on top/bottomIsaac Freund
These are very common operations for compositors (including tinywl) to perform.
2021-10-14scene: assert that node != sibling in place above/belowIsaac Freund
Currently these functions remove the node from the scene if the sibling argument is the same node as the node. To prevent confusion when misusing this API, assert that the nodes are distinct and document this.