Commit Graph

2920 Commits

Author SHA1 Message Date
Simon Ser
d2374b3e4e render/gles2: implement explicit sync API 2024-08-06 17:37:06 +00:00
Simon Ser
19ffbfe356 render/egl: add support for explicit sync extensions 2024-08-06 17:37:06 +00:00
Simon Ser
a1635fdb76 render: add explicit sync API 2024-08-06 17:37:06 +00:00
Philipp Kaeser
d400b4587a wlr_scene: Add 'struct' to comment in wlr_scene_create() to permit auto-linkify. 2024-08-04 11:57:27 +02:00
Philipp Kaeser
42df9414fb wlr_scene: Add documentation to wlr_scene_create about how to destroy the allocated resources. 2024-08-04 09:49:58 +00:00
Consolatis
ceb4fcedca xwm: expose individual axis for _set_maximized()
This allows compositors to support both axis individually.
To keep existing behavior, compositors can supply the same
maximized state for both axis.
2024-08-02 14:46:37 +00:00
John Lindgren
5083efe18b xwayland: add wlr_xwayland_surface_offer_focus()
In labwc, we have had trouble with XWayland windows using the Globally
Active input model (see wlr_xwayland_icccm_input_model()). Under
traditional X11, these windows do not expect to be given focus directly
by the window manager; rather, the WM sends them a WM_TAKE_FOCUS message
prompting the client to take focus voluntarily.

Currently, these clients are difficult to support with wlroots, because
wlr_xwayland_surface_activate() assumes the client window will always
accept the keyboard focus after being sent WM_TAKE_FOCUS. Some Globally
Active client windows (e.g. panels/toolbars) don't want to be focused.
It's useless at best to focus them, and might even make them misbehave.
Others do need keyboard focus to be functional -- and there doesn't seem
to be any reliable way to know this in advance.

Adding wlr_xwayland_surface_offer_focus() allows the compositor to send
WM_TAKE_FOCUS to a client window supporting it and then see whether the
client accepts or ignores the offer. If it accepts, the surface will emit
the focus_in signal notifying the compositor that it has received focus.

This is entirely opt-in. A compositor that doesn't want to use the new
function can continue to call wlr_xwayland_surface_activate() directly
just as before.
2024-08-01 13:19:24 +00:00
John Lindgren
eb5312022a xwayland: add focus_in and grab_focus events
Allows the compositor to know when the XWayland focus changes.
2024-08-01 13:19:24 +00:00
Isaac Freund
7550e483ae docs: update comments for wlr_output API changes
The old wlr_output_{commit,test}() functions are still mentioned in
multiple places.
2024-07-15 12:30:06 +00:00
Isaac Freund
2a8a23c467 wlr_output: remove dead function 2024-07-15 12:30:06 +00:00
Kirill Primak
e17916d413 Rename wlr_surface_get_extends() to wlr_surface_get_extents()
Extend (verb): cause to cover a wider area; make larger.
2024-07-13 19:56:58 +00:00
Isaac Freund
d3b7e040af wlr_xwayland_surface: fix prefix of two functions
Since we're breaking this API anyways, replace the ambiguous "or" in the
function name with the explicit "override redirect" to avoid confusion.
2024-07-13 19:56:58 +00:00
Isaac Freund
5ecbd23c1d wlr_surface: fix argument order consistency
This swaps the argument order of wlr_surface_accepts_touch() and
wlr_surface_accepts_tablet_v2(), putting the wlr_surface argument first
as should be the case for functions namespaced with wlr_surface_*.
2024-07-13 19:56:58 +00:00
Simon Ser
a35b4f059d backend/drm: add support for SIZE_HINTS property
This property allows the driver to advertise support for multiple
cursor sizes. On Intel, using a smaller buffer size reduces power
consumption.

References: https://lore.kernel.org/dri-devel/20240227193523.5601-2-ville.syrjala@linux.intel.com/
2024-07-10 22:42:44 +00:00
Simon Ser
0a79bc28c7 build: require libinput v1.19
This version has been published back in 2021.
2024-07-04 22:51:07 +02:00
Kirill Primak
67b88e46b0 Fix __VA_OPT__ macro invocations 2024-06-30 09:01:15 +03:00
Simon Ser
3880ee15d7 Use standard __VA_OPT__ instead of GNU's ##__VA_ARGS__
C23 has standardized a way to write variadic macros that accept
zero arguments:
https://open-std.org/JTC1/SC22/WG14/www/docs/n3033.htm

Use that instead of the GNU extension when available.
2024-06-27 18:13:05 +00:00
Simon Ser
fe429b2463 Switch to stable tablet-v2 protocol
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/284
2024-06-27 18:04:00 +00:00
Kirill Primak
f320df65e6 backend/wayland: introduce wlr_wl_output_set_app_id() 2024-06-26 19:43:20 +00:00
Kirill Primak
5201836868 backend/drm: store drm prop lists as structs
This makes modifying the property lists slightly easier.
2024-06-25 13:49:54 +00:00
Kenny Levinsen
47c578945c render/vulkan: Recycle memory maps for stage spans
Remapping buffers on every use causes a lot of unwanted pagefaults.
Reuse the mapping to significantly speed up the memcpy.
2024-06-24 15:55:10 +00:00
Kenny Levinsen
bedc890935 backend/drm: Use cached vrr support flag
We do not expect the connector support to change throughout the lifetime
of the link on this connector, so use the value we initially probed.
2024-06-21 14:18:34 +00:00
Kenny Levinsen
f10327f915 wlr_output: Add adaptive_sync_supported
This will let compositors know if changing adaptive_sync state has any
chance of working. When false, then the current state is the only
supported state, including if adaptive_sync is currently enabled as is
the case for Wayland and X11 backends.

When true, changing state might succeed, but no guarantee is made. It
just indicates that the backend does not already know it to be
impossible.
2024-06-21 14:18:34 +00:00
Simon Ser
213bd88b4c linux-drm-syncobj-v1: new protocol implementation
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/90
2024-06-12 18:40:25 +02:00
Simon Ser
d9bfb47648 render/drm_syncobj: add helpers to wait for timeline points
References: https://patchwork.freedesktop.org/patch/506761/
2024-06-12 18:39:45 +02:00
Simon Ser
ea75aa3065 render/drm_syncobj: add wlr_drm_syncobj_timeline_import() 2024-06-12 18:38:42 +02:00
Simon Ser
7fc00ef777 render/drm_syncobj: introduce wlr_drm_syncobj_timeline
wlr_drm_syncobj_timeline is a synchronization primitive based on
drm_syncobj timelines. They are heavily inspired from Vulkan
timeline semaphores [1].

[1]: https://www.khronos.org/blog/vulkan-timeline-semaphores
2024-06-12 17:45:06 +02:00
Kirill Primak
1e58e4006d xdg-popup: validate positioner on reposition request 2024-06-11 12:02:35 +03:00
Kirill Primak
629a5171f2 backend/wayland: don't ack outdated configures
This commit fixes the following interaction:

1) The host compositor sends a configure sequence for an output.
2) Before handling it, the guest compositor disables and immediately
re-enables the output.
3) The guest compositor tries to ack the configure event from step 1
which isn't relevant anymore after unmapping and re-initialization.

Instead, ignore all configure events after unmapping until we're sure
the host compositor has processed the unmapping.

Also see
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/108.
2024-06-11 09:44:42 +03:00
Kirill Primak
d80c46250d backend/wayland: improve/fix xdg_toplevel (re-)initialization
- Reset all variables representing an initialized xdg_toplevel's state
on unmap.
- Send an initial commit only when an output is about to be enabled.
- If an output isn't configured yet, don't commit a buffer.
2024-06-11 09:44:42 +03:00
Kirill Primak
baf1e4f674 backend/wayland: don't ack a configure event too early
Postpone sending xdg_surface.ack_configure until the guest compositor
commits a buffer, if at all.

Also see
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/128.
2024-06-11 09:44:42 +03:00
Kirill Primak
94e7165e85 backend/wayland: don't request a state too early
An xdg_toplevel configure sequence ends with xdg_surface.configure.
Wait for it before relaying the request to the guest compositor.
2024-06-11 09:44:42 +03:00
Kirill Primak
a62dfebf10 backend/wayland: store output xdg_toplevel title
This will be required to re-initialize the toplevel properly later.
2024-06-11 09:44:42 +03:00
Simon Ser
6d07193bda render/color: add fallback stub when LCMS2 is disabled
It's cumbersome for compositors to guard every
wlr_color_transform_ref() or wlr_color_transform_unref() call
behind a #if WLR_HAS_COLOR_MANAGEMENT. Moreover, none of the LCMS2
types are used in our public API.

Instead, always install the color.h header, and add a stub for
wlr_color_transform_init_linear_to_icc().
2024-06-04 17:45:51 +00:00
Kirill Primak
862a0b4826 fullscreen-shell: deprecate
There are no real-world clients that use this protocol.
2024-05-28 15:08:26 +00:00
Violet Purcell
4b4f76cc13 Version pkgconfig, headers, and library for parallel installation
Since wlroots almost always significantly breaks API each minor release,
allowing parallel installation of wlroots helps packagers deal with
programs that require conflicting versions of wlroots.

Closes: #3786
2024-05-27 22:15:00 +00:00
Simon Ser
8cd58bc53c render/allocator: document struct wlr_allocator 2024-05-25 13:28:19 +00:00
Isaac Freund
6219d7b819
wlr_surface: update get_root_surface() docs
Since destroying a wlr_surface now makes all subsurfaces inert, this
function can no longer fail and return NULL. Document this.
2024-05-15 15:54:38 +02:00
Alexander Orzechowski
53be443f39 wlr_scene: Add WLR_SCENE_HIGHLIGHT_TRANSPARENT_REGION env 2024-05-05 02:22:50 +03:00
Simon Ser
563f100627 alpha-modifier-v1: new protocol implementation
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/287
2024-04-30 17:49:34 +02:00
Consolatis
8abd43803b xwayland: remove saved_{width,height}
This has been introduced way back in
be297d9d14 but is never used anywhere.

If compositors want to save the old dimensions before reacting to a
fullscreen or maximize event they can just grab the sizes within their
event handlers instead.
2024-04-30 15:24:40 +00:00
Manuel Stoeckl
82b4bc3f5f renderer: add field to indicate color transform support 2024-04-26 17:17:36 +00:00
Manuel Stoeckl
391410deb5 wlr_scene: add color transform argument for rendering 2024-04-26 17:17:36 +00:00
Manuel Stoeckl
ffdbfdbbbd render/vulkan: add support for output color transforms 2024-04-26 17:17:36 +00:00
Manuel Stoeckl
e443434876 render/vulkan: create plain framebuffers on demand
This change makes it possible to support both the direct srgb-format
pipeline and indirect (color-managed, or non-srgb-format) pipeline
for the same render buffer.
2024-04-26 17:17:36 +00:00
Manuel Stoeckl
adbfd3c321 render/vulkan: add lut3d output shader option
While a corresponding pipeline is created, it is not yet used.
2024-04-26 17:17:36 +00:00
Manuel Stoeckl
c64144a39b render/vulkan: add dummy 3d lookup table to output shader
Later commits will add shader options that use a real 3d
lookup table.
2024-04-26 17:17:36 +00:00
Simon Ser
895e3d18b9 render/color: introduce wlr_color_transform
Co-authored-by: Manuel Stoeckl <code@mstoeckl.com>
2024-04-26 17:17:36 +00:00
Simon Ser
ebef710746 renderer: replace get_render_buffer_caps() with struct field 2024-04-22 11:38:30 +02:00
Simon Ser
0686666cf5 render: drop wlr_renderer_get_dmabuf_texture_formats()
wlr_renderer_get_texture_formats() with WLR_BUFFER_CAP_DMABUF is
the replacement.
2024-04-21 11:27:29 +00:00