Commit Graph

6700 Commits

Author SHA1 Message Date
Manuel Stoeckl a3d22dbe97 xdg-toplevel: check that title provided actually is UTF-8
While the xdg-shell protocol requires this, it does not yet have
a dedicated error code for invalid titles; this commit makes
wlroots send a generic error instead.
2023-11-22 22:03:00 +03:00
Simon Ser 41494244df render: drop legacy rendering API 2023-11-22 11:43:05 +01:00
Simon Ser b2aac3390d render/vulkan: drop legacy rendering API 2023-11-22 11:36:17 +01:00
Simon Ser 514caea437 render/pixman: drop legacy rendering API 2023-11-22 11:34:32 +01:00
Simon Ser 4635717d82 render/gles2: drop legacy rendering API 2023-11-22 11:33:10 +01:00
Simon Ser 0c83c331ca output/cursor: drop legacy rendering API 2023-11-22 11:30:14 +01:00
Simon Ser 40633ae7fd render: drop legacy render pass
All built-in renderers now implement the new API.
2023-11-22 00:55:56 +01:00
Kirill Primak 5dd614b9ad input-inhibitor: drop
wlr_input_inhibitor.h has been marked as deprecated in 0.17.0.
2023-11-21 20:10:18 +03:00
Simon Ser 3b4d7d2a92 build: bump version to 0.18.0-dev 2023-11-21 17:28:06 +01:00
Simon Ser fe53ec6937 tinywl: fix wlroots dependency constraint in Makefile 2023-11-21 17:22:02 +01:00
Simon Ser 767eedd3cb build: bump version to 0.17.0 2023-11-21 17:06:13 +01:00
Manuel Stoeckl dbe7fb7027 render/vulkan: undo alpha premult for 8-bpc ARGB/ABGR
When a texel from the Vulkan format VK_FORMAT_B8G8R8A8_SRGB is read,
the sRGB to linear conversion is applied independently to the R, G,
and B channels; the A channel has no influence on this. However,
DRM_FORMAT_ARGB8888 buffers are, per Wayland protocol, not encoded
in this fashion; one must first unpremultiply the color channels
before doing sRGB to linear conversion. This commit switches to
handling ARGB8888 and ABGR8888 formats using the general fragment
shader conversion from electrical to optical values.
2023-11-21 11:08:55 +00:00
Simon Ser fe6a432299 linux-dmabuf-v1: skip import check on split render/display SoCs
Unfortunately we have no way to get back the proper render node in
that case. This will be fixed with [1]: with that Mesa patch, the
wlr_renderer will return the proper render node and the existing
logic will work fine.

[1]: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3757
2023-11-20 19:54:16 +01:00
Alexander Orzechowski 515681503e screencopy: Use box size instead for shm copy
This doesn't change functionality, both the values are the same. Less
confusing to use the box size.
2023-11-20 11:33:11 -05:00
Alexander Orzechowski 7a22030071 screencopy: Move frame bounds sanity check into common code 2023-11-20 11:33:11 -05:00
Alexander Orzechowski c8861a2865 screencopy: Define proper destination for dmabuf copy
Leaving this empty would have it filled in with the size of the source
texture, but we want the destination size.

Fixes: #3758
2023-11-20 11:33:10 -05:00
Simon Ser bd18d5ccfc backend/drm: drop unnecessary flags in legacy interface
drm_crtc_commit() already ensures that atomic-only flags are
disallowed.
2023-11-19 15:32:30 +01:00
Simon Ser 8c44e86077 backend/drm: add wlr_drm_connector_state.nonblock
Instead of having this condition checked in multiple places,
centralize it so that they don't go out-of-sync.
2023-11-19 15:32:30 +01:00
Simon Ser f47b6e3fce backend/drm: fix pending page-flip check
This chunk of code was moved by mistake.

Fixes: 3b53d1cbf1 ("backend/drm: introduce page-flip tracking struct")
2023-11-19 15:14:22 +01:00
Kirill Primak c6b498528c xcursor: don't store NULL xcursors 2023-11-19 15:33:39 +03:00
Kirill Primak e16b0068a7 xcursor: fix NULL deref on malloc() fail 2023-11-19 15:33:39 +03:00
Alexander Orzechowski b06d58fa8b backend/drm: Destroy page flips on backend destroy
When we destroy the backend, page flips will no longer be invoked meaning
those won't clean up the page flips for us.
2023-11-17 14:34:32 -05:00
Alexander Orzechowski 3aed24b8d4 backend/drm: Track page flips in list 2023-11-17 13:49:18 -05:00
Simon Ser 3b53d1cbf1 backend/drm: introduce page-flip tracking struct
Introduce a per-page-flip tracking struct passed to the kernel
when we request a page-flip event for an atomic commit. The kernel
will pass us back this pointer when delivering the event.

This eliminates any risk of mixing up events together. In particular,
if two events are pending, or if the CRTC of a connector is swapped,
we no longer blow up in the page-flip event handler.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3753
2023-11-17 16:59:04 +00:00
sunzhguy c9c9dd6a5b backend/drm: free fb later
since 4932e0d347f("backend/drm: ensure plane surfaces are cleaned up on shutdown")
at finish_drm_resources called drm_plane_finsh_surface has already free the fb

Signed-off-by: zhoulei zhoulei@kylinos.cn
Signed-off-by: sunzhguy <sunzhigang1@kylinos.cn>
2023-11-17 12:38:21 +08:00
mfk530 92dabc3a01 xwayland: fix user_event_handler
Don't break and free event as the commont says:
wlr-xwayland will free the event.
2023-11-17 02:33:18 +00:00
Alexander Orzechowski 303f23d7dd wlr_scene: Update outputs if subpixel status changes
This is important for buffers that are meant to render any sort of
text.
2023-11-15 18:42:12 -05:00
Alexander Orzechowski 50446fe75e wlr_scene: Update outputs when primary output is changed
Helpers care about the primary output. They need to know when it changes
even if intersection status has not changed necessarily.
2023-11-15 18:42:12 -05:00
Alexander Orzechowski 889c5ed5ff wlr_scene: Update outputs when output scale/transform changes
We want to call the outputs updated signal when an output scale or transform
changes. Otherwise helpers like the scene surface helpers will not be
notified of scale changes and not pass them to clients.
2023-11-15 18:38:12 -05:00
Simon Ser b0bd86285f backend/drm: leave CRTCs on when shutting down
This avoids a black screen during multiple seconds on shutdown.
To fully allow for flicker-free transitions between DRM masters,
we will also need [1].

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4394

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3497
2023-11-15 01:37:59 +00:00
Simon Ser 4932e0d347 backend/drm: ensure plane surfaces are cleaned up on shutdown
Right now this is done "by chance" because we disable all CRTCs
on shutdown. However, we'll stop doing this. Plus, if disabling
a CRTC fails, we don't cleanup properly.
2023-11-15 01:37:59 +00:00
Kirill Primak 86b2cac921 Add missing type declarations in headers 2023-11-14 18:44:53 +00:00
Alexander Orzechowski 3d3cca9164 wlr_scene: Introduce wlr_scene_subsurface_tree_set_clip 2023-11-14 17:27:08 +00:00
Alexander Orzechowski d1ddd4ca3a wlr_scene_surface: Introduce scene_surface_set_clip 2023-11-14 17:27:08 +00:00
Alexander Orzechowski c6d356648c set_buffer_with_surface_state: Take whole surface struct 2023-11-14 17:27:08 +00:00
Alexander Orzechowski 1c0b10b61a wlr_scene_subsurface_tree: Addon to scene
We will need this later so that we can determine the subsurface tree
that owns any given scene node.
2023-11-14 17:27:08 +00:00
Alexander Orzechowski 33b437d574 wlr_scene: Amend scene_buffer.point_accepts_input to take coordinate pointers
The pointers mean that we can mutate them. This will be useful later
so we can hide details from the compositor when we clip subsurface trees.
2023-11-14 17:27:08 +00:00
Kirill Primak 6cf0bb4b19 tinywl: don't use "I"/"my" in docs 2023-11-14 19:46:04 +03:00
Kirill Primak 73a387d3b6 tinywl: fix xdg_toplevel_destroy() docs 2023-11-14 19:40:26 +03:00
Simon Ser 73ab5246ea tinywl: stop using the word "view" to refer to toplevels
"View" has been cargo-culted from Weston. In Weston, a view is not
even necessarily a toplevel -- it's just a way to draw an arbitrary
somewhere (a surface may be painted at multiple locations
simultaneously). The Weston concept has been misunderstood and then
was carried over to rootston, Sway, and tinywl.

Let's just use the official Wayland wording instead.
2023-11-14 17:31:35 +01:00
Simon Ser 9e5d0f95f8 tinywl: fix crash when previously focused surface is not a toplevel
It can be e.g. a popup.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3754
2023-11-13 10:32:03 +01:00
Simon Ser 319e4125ab xdg-shell: add wlr_xdg_{toplevel,popup}_try_from_wlr_surface()
Convenience helpers for compositors. Saves them the trouble of
manually checking the role (and if they forget to do so, prevents
an invalid cast).
2023-11-13 10:31:00 +01:00
Väinö Mäkelä 5de9e1a99d wlr-output-management: Send custom modes to clients
Since commit 5567aefb, fixed modes haven't been automatically generated
for custom modes, so the output management implementation needs to be
able to handle them directly. To avoid polluting the mode list, only a
single custom mode can be listed at a time and will be removed when a
fixed mode is set.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3744
2023-11-06 17:46:55 +00:00
Simon Ser 26eac25d7f ci: halt on UBSan error in smoke test
By default UBSan prints a message and carries on, which makes it
easy to miss errors.
2023-11-02 11:01:08 +01:00
Simon Ser dbedcdb418 xcursor: add fallbacks for legacy names
Some XCursor themes still use the legacy names instead of the newer
cursor naming spec [1]. Fall back to the legacy name if the standard
one could not be found.

[1]: https://www.freedesktop.org/wiki/Specifications/cursor-spec/

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3746
2023-11-01 13:13:22 +00:00
JiDe Zhang 8ebfeffdc8 Remove unnecessary code
Not needs set GL_DEPTH_TEST, Because when rendering to a framebuffer
that has no depth buffer, depth testing always behaves as though
the test is disabled, The initial value for each capability with
the exception of GL_DITHER is GL_FALSE.
2023-10-31 15:59:38 +00:00
Simon Ser 22df8d3847 cursor: log missing XCursor
Log a debug message when the XCursor theme is missing a cursor.
Eases debugging.

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3746
2023-10-31 13:37:00 +00:00
sunzhguy dbf20b0ad3 wlr_cursor: update cursor when output enable and transform changed
Signed-off-by: zhoulei <zhoulei@kylinos.cn>
Signed-off-by: sunzhguy <sunzhigang1@kylinos.cn>
2023-10-31 01:29:02 -04:00
Simon Ser 1c24b1182b backend: drop wlr_backend_get_presentation_clock()
We can just assume CLOCK_MONOTONIC everywhere.

Simplifies the backend API, and fixes clock mismatches when multiple
backends are used together with different clocks.
2023-10-30 18:39:39 +01:00
Kirill Primak 5fac9b1beb xdg-toplevel: don't send maximized if tiled is requested but not supported
This is a bit too magical and may break compositors which try not to
send duplicate configure events.
2023-10-29 15:51:12 +00:00