Update wlroots to version 0.20.2 - #1249
Conversation
Global should be created after all other initialization finished. Free manager in err_options.
Check if image description is valid. If not, post error to client.
The cursor can be expected to also be transformed if the output is transformed.
During suspend, we first disable output and then remove the input device. This causes cursor->state->surface released while cursor->texture leaves. Which leads to use-after-free after resume.
Remove the redundant wlr_ext_foreign_toplevel_image_capture_source_v1 struct that was not used anywhere in the codebase.
color-representation was added in 1.44. Fixes: eff6207
This makes it easier for protocol implementers to tie everything together with wlroots backends and renderers.
Add listener for wlr_seat->pointer_state.events.focus_change Fix #3802
This reports the output properties according to the current image description.
Firefox needs this to report HDR support to documents, at least.
v2: Move abort() calls out of switch to eliminate default case. Rename
functions so they don't use a wlr_ prefix like public functions do.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Fixes #4001 Reported-by: CreeperFace / @dy-tea Signed-off-by: Christopher Snowhill <kode54@gmail.com>
We can't expect all clients to support all fancy formats. WebRTC's reference implementation doesn't support 10-bit formats yet. More generally, clients are limited by the libraries they use: for instance, Pixman doesn't implement all OpenGL/Vulkan formats. Another MR [1] suggests advertising all render formats. This is a bit heavy-handed because: - Upgrading a 8-bit buffer to a 10-bit buffer doesn't make a lot of sense. I don't think the compositor should expose arbitrary pixel format conversions. - The protocol has no preference order. Clients generally pick the first format they receive and support. As an alternative, only advertise two fallback formats, ARGB8888 and XRGB8888. These two are already hard-required by wl_shm and all clients should be able to handle them. [1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/5019
When we fail to render the cursor (in my case because the cursor is too large) we bail out of the output_cursor_attempt_hardware function. This causes output_cursor_set_texture to clean up after us, but we've already cleared the hardware_cursor, and so output_disable_hardware_cursor thinks we don't have a hardware cursor to disable. We shouldn't modify the hardware_cursor variable before we've successfully changed the hardware cursor, this way the caller can clean up after us like it expect to. This was brought up by an actual bug when playing the game Kaizen. Which uses oddly sized cursors, that fell back to software cursors for me, and left the hardware cursor hanging around. This change has been tested to fix that. During the testing of this change, I have noticed that the previous code worked fine the first time the cursor was switch to software. It only failed on subsequent attempts. I haven't figured out why that is.
…_commit() We were iterating over involved outputs, applying the new state and sending the commit event for each one. This resulted in commit events being fired while we weren't done applying the new state for all outputs. Fix this by first applying all of the states, then firing all of the events. Closes: swaywm/sway#8829
This is possible now that w-p ships enum headers. The remaining includes are from wlr-protocols.
wlr_output_from_resource() can return NULL if the outputs no longer exists on the compositor side. Closes: swaywm/sway#8847
Signed-off-by: xurui <xurui@kylinos.cn>
Signed-off-by: xurui <xurui@kylinos.cn>
We don't need to do this anymore for wayland-protocols.
We pass an alpha multiplier plus a luminance multiplier now.
Fixes the following validation layer error:
vkCmdPushConstants(): is called with
stageFlags (VK_SHADER_STAGE_FRAGMENT_BIT), offset (80), size (72)
but the VkPipelineLayout 0x510000000051 doesn't have a VkPushConstantRange with VK_SHADER_STAGE_FRAGMENT_BIT.
The Vulkan spec states: For each byte in the range specified by offset and size and for each shader stage in stageFlags, there must be a push constant range in layout that includes that byte and that stage (https://docs.vulkan.org/spec/latest/chapters/descriptorsets.html#VUID-vkCmdPushConstants-offset-01795) (VUID-vkCmdPushConstants-offset-01795)
Fixes: 56d95c2 ("render/vulkan: introduce wlr_vk_frag_texture_pcr_data")
Use the array size instead.
Add deprecation notice for wlr_data_control_v1, indicating that it's superseded by ext-data-control-v1. Related: https://gitlab.freedesktop.org/wlroots/wlr-protocols/-/merge_requests/136
We grab header files from there, ensure include directories are properly set up when building wlroots. Fixes missing header files when a wayland-protocols subproject is used.
Upon leasing, the wlr_drm_lease_connector_v1 will be automatically clean up by the wlr_output destroy handler. There is no need for the wlr_drm_lease_manager to keep track of leased connectors.
When locking surface state, surface_cache_pending will move the pending surface state to a new, empty `wlr_surface_state`. This new surface state will only contain the fields committed in the pending state, as surface_state_move does not copy anything else. surface_update_damage is called before we move state from pending to current to merge buffer damage and surface damage, and it expects that the pending surface state still contains prior committed details such as scale and transform. This is not the case when we finally commit the cached surface state. Move surface_update_damage after surface_state_move and make it operate purely on the current surface state. (cherry picked from commit fba00c4a04f7fcd4144d51d51915e33421b04950)
Signed-off-by: xurui <xurui@kylinos.cn> (cherry picked from commit 19df074c1615cf71633c9a022799e78bc72040ce)
In handling scene buffer output updates, wlroots would send a leave event to all entered outputs, even those that the scene root for the scene output update event did not own. Leaving the output list inaccurate. Sending leave events only for the given scene introduces a problem, though: existing logic to de-duplicate leave events stops us from sending a leave event when we leave all the outputs in a scene, and when the surface then becomes visible in another scene, the frame pacing output cannot be selected accurately. This breaks screen capture for off-screen windows in sway. So, let us also mark outputs that would have been left but were spared by the deduplication logic as "suspended" indicating they are ineligible as frame pacing outputs. Fixes: swaywm/sway#9094 (cherry picked from commit e532b4c26c53b60cca6e7bb998f6e12c6e47dfca)
The size of the VLA is client-controlled and can overflow the stack. Instead, allocate on the heap. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/work_items/4090 (cherry picked from commit cb0fa9b0a3883689179532c20a67cc8ea3b53969)
These values must not be mutated, they are owned by the xcb_get_property_reply_t. (cherry picked from commit 9d6c9e8783f1eef575aee450a146d4fdc8ad2978)
We advance the class pointer here, but we forgot to decrease the length. (cherry picked from commit 851cdd0089004884bd85a95ad21f04009cb5a53a)
Make it clear this doesn't contain a single atom. (cherry picked from commit 5cb537395966bd96768b5ddc870894940932ae5e)
This field is difficult to use correctly, its meaning depends on format. xcb docs read: > You should use the corresponding accessor instead of this field. Replace all uses with the safe accessor. This fixes potential out-of-bounds array accesses when the format field isn't what we expect. (cherry picked from commit c91543352aff18052946e6ac3703a152f66307d7)
(cherry picked from commit 73d6968cd00c7549677fcc3c4a4ae4f9b012c41f)
Make it clearer what's up. (cherry picked from commit 041aa8c0488a4bcfab220aaa841e926a5639d788)
…ACE_ID xwayland_surface_associate() asserts that the surface has not yet been associated yet. Arbitrary clients can send these messages, don't abort when that happens. (cherry picked from commit 8154d80a4d39e03c1ccc80b9a2e8a04b40a2091e)
wlr_surface_from_resource() asserts that the object is a wl_surface. Since arbitrary clients can send such messages, avoid aborting on invalid input. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/work_items/4093 (cherry picked from commit c6e2af1155257f92857bbd05ac4d721a86c4cc5a)
Without this check, the reply value might be smaller than xcb_window_t and will result in an invalid memory read. Reported-by: Tristan <TristanInSec@gmail.com> (cherry picked from commit 63318d28b1ea86873eeb1023d88e56d57bdd2453)
When a xwayland surface is destroyed, its children's parent pointer is set to NULL, but the set_parent signal was not emitted. (cherry picked from commit a94cd29eb13fc2fb68f2fe2d053fef29fb6ae712)
The comparison done in `scene_buffer_send_dmabuf_feedback()` is sufficient. Close https://gitlab.freedesktop.org/wlroots/wlroots/-/work_items/4088 (cherry picked from commit 3bd8f29b138e2832870ad05a9386002fcc79e0fc)
Signed-off-by: xurui <xurui@kylinos.cn> (cherry picked from commit 6dcc061a7946430428c82cdb2609aeb1956eafa8)
fixes a typo in https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/c91543352aff18052946e6ac3703a152f66307d7 (cherry picked from commit c3f75870689ce577f5bf405f9c372eca448b5c36)
…e_outputs() A node can have a visible area outside the output layout bounds. In that case, it will not pass the overlap check. For instance, with a single output, a 100x100 px weston-simple-shm would stop animating when moving it close to an edge and leaving less than a ~30x30 px square visible. Fix this by intersecting the node's visible region with the output layout region so that the 10% overlap target is always reachable. Switch to a strict comparison in case visible_area is zero. (cherry picked from commit d70c84b5717dafd922f434b022873b7f1b276543)
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/work_items/3949 (cherry picked from commit 327f000532e96329280e06eb12af2d98071ac023)
# Conflicts: # 3rdparty/wlroots/meson.build # 3rdparty/wlroots/render/vulkan/pass.c # 3rdparty/wlroots/types/scene/surface.c
Detect linux/sync_file.h through CMake and expose the result in the generated internal config.h, matching the Meson configuration. This prevents wlr_linux_drm_syncobj_v1.c from failing to compile because HAVE_LINUX_SYNC_FILE is undefined. Log: fix wlroots CMake build failure Influence: wlroots CMake builds compile linux-drm-syncobj support successfully
Add #define static guards around wlroots headers that use C99 [static N] array parameter syntax, including wlr/backend.h and color-related headers, so C++ consumers can parse wlroots 0.20 headers correctly. Log: fix C++ build errors from wlroots static array parameters Influence: qwlroots C++ targets compile with wlroots 0.20 headers
Upgrade the vendored wlroots sources and dependencies from 0.19.3 to 0.20.2, and adapt qwlroots and waylib to the updated color transform, scene frame, input, text-input, XWayland, and image capture APIs. Replace gamma LUT state handling with reference-counted color transforms, and add the newly introduced wlroots sources and staging protocols. Log: upgrade wlroots and adapt compositor integrations to 0.20.2 Influence: treeland and waylib build with wlroots 0.20.2
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: zzxyb The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
CLA Assistant Lite bot: 3 out of 20 committers have signed the CLA. |
Reviewer's GuideUpdate vendored wlroots to 0.20.2 and integrate new upstream features: color management and HDR support, Vulkan color pipeline changes, Xwayland/X11 robustness tweaks, DRM timeline and HDR metadata, Wayland protocol updates, and corresponding Waylib/QW bindings, while refactoring scene graph, cursor, and output handling to use new APIs. Sequence diagram for color-managed frame rendering and HDR outputsequenceDiagram
participant SceneOutput as wlr_scene_output
participant Renderer as wlr_renderer
participant VkPass as vulkan_begin_render_pass
participant DRM as drm_atomic_connector_prepare
SceneOutput->>SceneOutput: wlr_scene_output_build_state(state, options)
Note right of SceneOutput: scene_output_combine_color_transforms()
SceneOutput->>Renderer: wlr_renderer_begin_buffer_pass(buffer, buffer_pass_options{ color_transform })
Renderer->>VkPass: vulkan_begin_render_pass(renderer, render_buffer, options)
VkPass->>VkPass: unwrap_color_transform()
VkPass->>VkPass: render_pass_add_texture(... transfer_function, primaries, color_encoding, color_range, luminance_multiplier)
VkPass-->>Renderer: render_pass_submit()
Renderer-->>SceneOutput: buffer rendered
SceneOutput->>DRM: wlr_scene_output_build_state -> output_pending_image_description()
DRM->>DRM: create_hdr_output_metadata_blob()
DRM->>DRM: convert_primaries_to_colorspace()
DRM-->>SceneOutput: updated state
SceneOutput->>DRM: drm_atomic_connector_prepare()
DRM->>DRM: drm_atomic_connector_apply_commit()
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
TAG Bot New tag: 0.8.18 |
Summary by Sourcery
Update vendored wlroots to 0.20.2 and integrate its new color management, rendering, and protocol features while adapting local Waylib/Qt glue code.
Enhancements:
Build:
Tests:
Chores: