Commit Graph

2067 Commits

Author SHA1 Message Date
John Lindgren
6214144735 xwayland: add wlr_xwayland_surface_has_window_type()
The infrastructure to read _NET_WM_WINDOW_TYPE already exists in wlroots
(it's used for example in wlr_xwayland_or_surface_wants_focus()). But
the window type isn't easily accessible to the compositor because the
atoms to compare against are private to xwm.c.

labwc has recently gone to a fair amount of effort (including opening a
whole new xcb connection) just to get the needed window type atoms:
a04b394e59

It seems much cleaner to add the remaining few (3) atoms to wlroots and
implement a shared function which can be used by any wlroots compositor.

v2: naming updates
2024-08-10 16:10:34 +00:00
Consolatis
0a388a14f1 xwm: supply wlr_xwayland pointer to user_event_handler callback
Previously it was supplying a pointer to private struct wlr_xwm
which was useless for compositors. The wlr_xwayland pointer in
contrast does have a generic data field and thus can be used by
compositors to attach their own pointer.

Additionally change the return value from int to bool.
2024-08-08 17:00:08 +00:00
Consolatis
20997df416 xwm: add request_close signal
This is especially useful if the compositor wants to support X11
panels to control windows. Without the signal a compositor does
have to hook into the user_event_handler callback but that would
not change the _NET_SUPPORTED root window property.
2024-08-08 15:49:11 +00:00
Simon Ser
df4a1d94e2 scene: fix typo in wlr_scene_surface_create() docs 2024-08-08 09:16:46 +02:00
Simon Ser
1c7e1bcc28 scene: use numbers instead of stars for doc refs
I find these slightly more readable (because the whole comment has
a stars column on the left side).
2024-08-08 09:14:48 +02:00
Alexander Orzechowski
14446216f4 wlr_scene: Improve wlr_scene_surface_create documentation 2024-08-07 16:47:27 -04:00
Alexander Orzechowski
4b4ca11f6f util/box: Introduce wlr_box_contains_box 2024-08-06 20:00:01 -04:00
Kirill Primak
8730ca9661 seat/pointer: handle duplicate presses/releases correctly 2024-08-06 22:53:08 +00:00
Simon Ser
738bbf01ee cursor: add support for linux-drm-syncobj-v1 2024-08-06 17:37:06 +00:00
Simon Ser
5f88635118 scene: add explicit synchronization for rendered buffers 2024-08-06 17:37:06 +00:00
Simon Ser
850dd7a792 linux-drm-syncobj-v1: add helper to signal on buffer release 2024-08-06 17:37:06 +00:00
Simon Ser
c7035da5e2 scene: add timeline point to wlr_scene_buffer_set_buffer() options 2024-08-06 17:37:06 +00:00
Simon Ser
48f0902a36 scene: add wlr_scene_buffer_set_buffer_with_options()
This is an extensible version of wlr_scene_buffer_set_buffer().
2024-08-06 17:37:06 +00:00
Simon Ser
edb867bc05 render/drm_syncobj: add wlr_drm_syncobj_timeline_export() 2024-08-06 17:37:06 +00:00
Simon Ser
5552de65f8 render/drm_syncobj: add wlr_drm_syncobj_timeline_transfer() 2024-08-06 17:37:06 +00:00
Simon Ser
1ad42bea99 output: add explicit sync API 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
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
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
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
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