Commit Graph

1882 Commits

Author SHA1 Message Date
Alexander Orzechowski e1e911d425 scene_output_layout: Don't destroy output when output layout is destroyed
There were a couple of problems with this:
1. The behavior is unexpected. Typically objects in wlroots won't
also destroy objects that they depend on. For instance, wlr_scene_output
will not destroy the wlr_output when it's destroyed. It shouldn't be any
different for scene layouts.
2. This fixes a crash where because wlr_output_layout and wlr_scene_output
are both addons to wlr_output, we might get into a situation where
wl_list_for_each_safe might malfunction. See [1]

This means that the compositor needs to manually destroy the output
when they destroy the layout, hence ~breaking. Compositors can just
call `wlr_scene_output_destroy()` if they want to destroy both at the
same time.

[1] https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4358#note_2106260

This reverts commit 1a731596c5.

Co-authored-by: Kirill Primak <vyivel@eclair.cafe>
2023-10-07 13:31:20 -04:00
Alexander Orzechowski 5fb0007e02 output_event_commit: Remove committed and buffer
The newly introduced state struct can be used to retrieve this.
2023-10-06 10:06:01 +00:00
Alexander Orzechowski 03e240a7f2 wlr_output: Add applied state to commit event 2023-10-06 10:06:01 +00:00
Kirill Primak 86c30b8715 seat: remove wlr_seat_validate_grab_serial()
It makes little sense to have a catch-all grab vaildation function,
considering that e.g. tablet tool implicit grabs are possible as well.
Besides, the function has always returned true anyway.
2023-10-06 08:51:47 +00:00
JiDe Zhang ca19014af0 xwayland: fix double free wlr_xwayland_shell_v1 2023-10-06 10:04:11 +02:00
Simon Ser e58c7bb792 render/drm_format_set: use published kernel doc URL
The kernel patch has been merged, so this is available in the
official docs now.
2023-10-05 21:29:25 +00:00
Simon Zeni a289f812d6 drop KDE idle protocol support 2023-10-04 12:19:30 -04:00
Simon Ser ddfec31b4c xdg-shell: document wlr_xdg_surface's initialized & initial_commit 2023-10-04 14:50:48 +00:00
Kirill Primak a09d649439 docs: replace the less commonly used "::" with "." 2023-10-02 22:10:16 +03:00
Kirill Primak 0fdbdc36c0 xdg-surface: fix init state flow
Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3677
2023-10-02 18:37:09 +00:00
vaxerski c2aa7fd965 backend/drm: Add async page flip support to legacy
Atomic doesn't support such flags yet.
2023-09-28 16:53:08 +00:00
vaxerski 5dec1c8bcb staging/tearing-control: Add protocol support 2023-09-28 16:53:08 +00:00
John Lindgren 1a731596c5 wlr_scene: clarify wlr_scene_output ownership semantics
wlr_scene_output_layout_add_output() was made public by f5917f0247
("scene_output_layout: make output adding explicit") but the ownership
semantics are not obvious and should be clarified.
2023-09-22 21:18:16 -04:00
Alexander Orzechowski 5299d973d5 render/pass: Introduce wlr_render_rect_options_get_box 2023-09-21 02:25:34 -04:00
Kirill Primak 4565b07484 Unify signal data docs
`// struct <name>` appears roughly 4 times as often as
`// struct <name> *`. Switch to the former variant everywhere.
2023-08-23 19:43:26 +00:00
Manuel Stoeckl a94168b5fe render: ensure wlr_render_rect_options->box is nonempty
This optimization also fixes an validation error with the Vulkan
renderer by ensuring vkCmdClearAttachments does not receive empty
regions.
2023-08-23 18:28:58 +00:00
Simon Ser e5fc8cd4c7 output: trigger frame/present events on all commits on enabled output
Up until now, frame/present events were only triggered when the
user submitted a buffer. Change the wlr_output API so that these
events are triggered when any commit is applied on an enabled
output.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3708
2023-08-23 15:42:22 +00:00
Rose Hudson f5917f0247 scene_output_layout: make output adding explicit
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3709
2023-08-22 11:53:28 +02:00
Rose Hudson 91f813ffb7 output_layout: return wlr_output_layout_output when adding output
This will be used for the scene-graph integration.
2023-08-22 11:53:25 +02:00
Simon Ser 72787db98a compositor: drop wlr_surface_destroy_role_object()
This function is now unnecessary.
2023-08-21 18:56:09 +02:00
Kirill Primak bd5c4f4a4a xdg-shell: rework roles 2023-08-21 16:30:29 +00:00
Simon Ser 9b8cd1f5d6 buffer: make wlr_client_buffer functions private
We want to eventually remove this. Let's make sure compositors
don't start using either of these functions.
2023-08-21 15:45:10 +00:00
Leonardo Hernández Hernández bdc34401ba
xdg-decoration: store an xdg_toplevel instead of xdg_surface
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3685
2023-08-19 11:10:36 -06:00
Simon Ser d3d3e19ffd render: split render pass API into separate header
Keeps the main wlr_renderer.h a tad more tidy.
2023-08-16 19:20:12 +02:00
Alexander Orzechowski 568b1943b9 wlr_output: Nuke wlr_output_update_enabled 2023-08-16 18:37:55 +02:00
Alexander Orzechowski f1ba70ffa6 wlr_output: Make wlr_output_update_{custom,}_mode private
Backends should be using wlr_output_send_request_state to request
modesets to the compositor. This will be inlined and removed next commit.
2023-08-16 18:37:55 +02:00
Alexander Orzechowski 6cda3e251c output: Add initialization state to wlr_output_init 2023-08-16 11:46:27 -04:00
Simon Ser 8678633fc9 backend/wayland: add wlr_wl_output_create_from_surface()
By using this function, a compositor can display a wlroots
compositor in a sub-surface, for instance.
2023-08-16 16:39:52 +02:00
Simon Ser dd24991c9e backend/wayland: take existing wl_display in wlr_wl_backend_create()
This allows compositors to use an existing wl_display, to integrate
wlroots with an existing toolkit.
2023-08-16 16:29:09 +02:00
Simon Ser 77dc1c28aa xwayland: drop wlr_xwayland_surface.events.set_pid
The PID of an X11 window cannot change.

This is a remnant from the days when we queried the PID with a
window property, instead of using XRes.
2023-08-03 03:19:35 +00:00
Kirill Primak 42a5b6f62a compositor: add "mapped" flag doc 2023-07-26 20:39:03 +00:00
Kirill Primak 529f1b82ee xwayland/shell: don't listen to wlr_surface.events.destroy
The wlr_xwayland_surface_v1 will be destroyed automatically
from xwl_surface_role_destroy().
2023-07-26 20:31:03 +00:00
rewine 2f859f5bec
wlr_output: add comments for signal parameters 2023-07-26 13:55:34 +08:00
Leonardo Hernández Hernández e8d545a977
xdg-shell: add support for v6
This adds the suspended toplevel state
2023-07-23 20:30:43 -06:00
Simon Ser 04e4e06986 cursor-shape-v1: new protocol implementation
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/194
2023-07-24 01:00:19 +00:00
rewine f3cf830e9a wlr_idle_inhibit_manager_v1: add comments for signal parameters 2023-07-21 02:35:48 +00:00
Kirill Primak 7791ffe058 data-device: remove undefined grab interface decls 2023-07-17 16:24:05 +00:00
Kirill Primak c6603288fb xdg-shell: update stale docs 2023-07-17 19:12:02 +03:00
Simon Ser 000081db19 cursor, output: apply viewport to cursor
Instead of passing the scale, pass the source and destination
boxes.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3676
2023-07-17 14:55:22 +00:00
John Lindgren 657ca2205f wlr_gamma_control: add missing forward declarations
Fixes an error seen in labwc CI builds with -Werror:

    ../subprojects/wlroots/include/wlr/types/wlr_gamma_control_v1.h:44:16:
    error: ‘struct wlr_output_state’ declared inside parameter list
    will not be visible outside of this definition or declaration [-Werror]
       44 |         struct wlr_output_state *output_state);
          |                ^~~~~~~~~~~~~~~~
2023-07-17 10:10:06 -04:00
Simon Ser 67447d6cb4 presentation-time: add separate helper for zero-copy
The backend is not able to tell whether a surface is being
presented via direct scan-out or not. The backend will set
ZERO_COPY if the buffer submitted via the output commit was
presented in a zero-copy fashion, but will no know whether the
buffer comes from the compositor or the client.
2023-07-14 15:20:35 +02:00
Simon Ser fe84bfc8d9 scene: add wlr_scene_output_sample_event
This contains the output and a bool indicating direct scan-out.
2023-07-14 15:16:12 +02:00
Simon Ser 88942d43fd scene: rename output_present event to output_sample
Using "present" is confusing here: the event is emitted when the
buffer is being sampled to be displayed on an output, not when it's
being presented on-screen.

Rename to match the presentation-time terminology.
2023-07-14 15:06:13 +02:00
Simon Ser 4811d9fb18 render: document wlr_buffer_pass_options.timer 2023-07-11 18:19:03 +00:00
Simon Ser b7dca21c2b render: constify struct wlr_buffer_pass_options
Let's not allow renderer implementations to mutate the passed in
options.
2023-07-11 18:19:03 +00:00
Rose Hudson 214df8eda0 scene_output: optionally record and report timings 2023-07-10 09:57:02 +00:00
Simon Ser 5bb0057794 xwayland: document event data 2023-07-09 11:48:51 +02:00
Simon Ser 19ba3f0c2a xwayland: drop struct wlr_xwayland_move_event
This only contains the xsurface, which isn't particularly useful.
2023-07-09 11:48:16 +02:00
Simon Ser 972c5f0c11 xwayland: document associate/dissociate events 2023-07-09 11:47:05 +02:00
Simon Ser 6f8287128b output: drop wlr_output_cursor_set_image()
This function takes a pointer to memory with a hardcoded format
and many parameters to describe the pixel buffer.
wlr_output_cursor_set_buffer() can be used instead.
2023-07-03 09:46:54 +02:00