Commit graph

2745 commits

Author SHA1 Message Date
Kirill Primak
9dbf5b9f6b fullscreen-shell: remove
The protocol implementation has been marked as deprecated in the
previous release.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3846
2025-03-30 01:15:09 +03:00
Simon Ser
128cd07e91 scene/surface: use source buffer to signal release timeline point
We were signaling the release timeline point when the
wlr_client_buffer was released. However, the wlr_client_buffer isn't
necessarily released at the same time as the underlying source
wlr_buffer. For instance, with wl_shm the source buffer is released
before the wlr_client_buffer, and with linux-dmabuf-v1 the source
buffer is released after the wlr_client_buffer. However, we want
to signal the release timeline point exactly at the same time we
send the wl_buffer.release event to the client.

Use surface->buffer->source instead of &surface->buffer->base to
fix this.

linux-drm-syncobj-v1 can only be used with DMA-BUFs, and
wlr_client_buffer.texture will keep the source locked, so
surface->buffer->source is guaranteed to be non-NULL and unreleased.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3940
Fixes: 9e71c88467 ("scene: unwrap wlr_client_buffer for direct scan-out")
2025-03-22 23:55:24 +00:00
liupeng
31f9d6bb97 screencopy-v1: drop output_enable listener 2025-03-10 15:33:46 +08:00
yuiiio
a63e21d94c output: don't update disabled cursor texture 2025-03-06 13:55:53 +00:00
Simon Ser
3c76b93272 output/cursor: drop output_cursor_reset()
This function is ill-named: it doesn't reset anything. It probably
contained more logic in the past and got stripped down.
2025-03-06 13:30:03 +00:00
Kirill Primak
a9542b9565 scene: don't mention damage in region-scaling functions 2025-03-03 17:57:48 +03:00
Kirill Primak
602a00ec1f scene: don't always round scaled regions up
It makes sense for damage, less so for opaque regions.
2025-03-03 14:50:57 +03:00
Kirill Primak
66dfb7f49b xdg-shell,layer-shell: assert that configure events are only sent to initialized surfaces
This helps to ensure that compositors behave correctly and don't confuse
clients.
2025-03-01 16:07:11 +00:00
David Turner
c9d6339b60 Fix includes of wlr_output.h
Remove unneeded includes of wlr_output.h from wlr_compositor.h and
wlr_cursor.h (unneeded now that we forward-declare struct wlr_surface)
and put the actually-required includes in the right places.
2025-02-21 13:44:42 +00:00
Kenny Levinsen
dc7dba8b1f scene/surface: Do not use buffer dimensions for clip
The surface's buffer dimensions were used to scale the clip's x/y
offset. If a surface had a larger buffer than src_box, the calculations
to scale the x/y portion of the clip would be incorrect, yielding
graphical glitches.

This was noticed with Chromium in sway, which during resize uses a
viewport with a src_box to avoid immediate buffer reallocation. While
the viewport was in use, the surface would be shifted so that too much
content was cropped in the upper left, and damage glitching was visible
in the lower right.

Use the buffer source box dimensions instead.
2025-02-18 14:39:17 +00:00
James Ramsey
16f607f008 Implement updated version of ext-idle-notify protocol
Signed-off-by: James Ramsey <james.jehiel.ramsey@gmail.com>
2025-02-14 18:57:37 +00:00
Guido Günther
fef4f3637a seat: Don't forget to destroy touch points on touch up
Otherwise the number of touch points goes up constantly and d'n'd via
touch can't work as validation always fails.

Fixes 75ecba44 ("seat: add serials to touch up events")

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-02-13 16:41:05 +00:00
Alexander Orzechowski
d305934ebe ext_data_control: Add protocol implementation 2025-01-31 18:39:17 +00:00
Simon Ser
83c5b15194 Remove all calls to pixman_region32_not_empty()
Replace them with pixman_region32_empty(), which avoids using a
double-negative when checking if a region is empty. Also use that
new function when checking for non-empty regions so that only one
variant of the Pixman API is used.
2025-01-29 23:37:06 +01:00
Simon Ser
639ca05d35 matrix: move to util/
wlr_matrix is not a standalone type like other headers in types/,
it's more of an internal utility. Move it to the appropriate place.
2025-01-27 17:48:18 +01:00
Alexander Orzechowski
82223e451a render/drm_syncobj: Add a callback when ready
The old approach of using a signal is fundamentally broken for a common
usecase: When the waiter is ready, it's common to immediately finish and
free any resources associated with it.
Because of the semantics of wl_signal_emit_mutable() this is UB.
wl_signal_emit_mutable() always excepts that the waiter hasn't been freed
until the signal has finished being emitted.

Instead of over engineering the solution, let's just add a callback required
by wlr_drm_syncobj_timeline_waiter_init(). In this callback, the implementation
is free to finish() or free() any resource it likes.
2025-01-26 18:02:05 -05:00
Simon Ser
211eb9d60e matrix: drop rotation
It's unused.
2025-01-26 17:56:04 +01:00
Simon Ser
7d1f535e49 matrix: drop wlr_matrix_transpose()
It's unused.
2025-01-26 17:52:39 +01:00
Simon Ser
9b55737cf5 Make wlr_matrix private API
36cc698bc5 ("matrix: deprecate") has deprecated wlr_matrix more
than one year ago. It's now time to drop it from our public API.
2025-01-26 17:46:50 +01:00
Guido Günther
1ee3ed4310 buffer: Make wlr_buffer_is_opaque public
It's useful for compositors.
2025-01-25 23:42:49 +01:00
Kirill Primak
b25f98d583 pointer-constraints: use wlr_surface_synced.commit hook
This fixes a problem where an outdated surface input region was used to
compute the effective confinement region.

Additionally, this commit fixes a bug in pointer_constraint_create()
which caused the initial region to not be applied immediately.

This is a breaking change: set_region is now emitted before the role
commit hook is called, and it's not emitted if the region hasn't
actually changed.
2025-01-17 16:30:34 +00:00
Kirill Primak
c3224d4160 compositor: add wlr_surface_synced commit hook 2025-01-17 16:30:34 +00:00
Kirill Primak
e3596abc9a pointer-constraints: fix deactivating oneshot constraint on destroy 2025-01-17 16:03:36 +00:00
Kirill Primak
8f56f7ca43 Assert (almost all) signals have no attached listeners on destroy 2025-01-15 19:53:11 +03:00
Kirill Primak
b03b05d2b3 xdg-dialog: add missing wm destroy signal 2025-01-15 19:51:05 +03:00
Kirill Primak
bcf8e467db xdg-toplevel-icon-v1: add implementation 2025-01-14 18:46:43 +00:00
Simon Ser
061aa1bd15 ext-image-copy-capture-v1: implement PAINT_CURSORS flag
This is unreliable because this is first come, first served: the
first capture stream decides whether or not cursors will be
included. Moreover, if the output lacks hw cursor support, cursors
will always be included. But it's the best we're going to get with
automatic wlr_output sources (and has bug parity with
wlr-screencopy-unstable-v1).
2025-01-14 16:42:12 +01:00
Simon Ser
6bb8bb1cb7 ext-image-capture-source-v1: add start/stop hooks
This allows the source to change its behavior when actively
captured.
2025-01-14 16:42:12 +01:00
Simon Ser
248e837cb3 ext-image-capture-source-v1: add output cursor source 2025-01-14 16:42:12 +01:00
Simon Ser
c0881bdc01 output: require commit after hardware cursor update
Up until now only the DRM backend required an output commit after
updating the cursor. Unify this for all backends, because:

- Screen capture can now catch cursor updates listening for output
  commits
- In the future we want to make the cursor a regular wlr_output_layer,
  which would need an output commit to be updated anyways
2025-01-14 16:42:12 +01:00
Simon Ser
08e14deeca ext-image-capture-source-v1: add output source 2025-01-14 16:42:12 +01:00
Simon Ser
855b3fd607 ext-image-capture-source-v1: add wlr_ext_image_capture_source_v1_set_constraints_from_swapchain() 2025-01-14 16:35:52 +01:00
Simon Ser
c24efad6df ext-image-copy-capture-v1: add wlr_ext_image_copy_capture_frame_v1_copy_buffer() 2025-01-14 16:35:52 +01:00
Simon Ser
4e4155ccbe ext-image-copy-capture-v1: new protocol implementation
Co-authored-by: Andri Yngvason <andri@yngvason.is>
2025-01-14 16:35:50 +01:00
Simon Ser
6712e774d4 ext-image-capture-source-v1: add source pointer cursors 2025-01-14 16:34:11 +01:00
Simon Ser
dadcbf65e6 ext-image-capture-source-v1: add base interface 2025-01-14 16:34:11 +01:00
llyyr
62ecec6d53 wlr_drag: cleanup icon_destroy listener when destroying icon 2025-01-11 20:20:10 +05:30
Kirill Primak
d5d650f9f6 output: introduce wlr_output_finish() 2025-01-08 16:06:12 +00:00
Kirill Primak
7963ba6a0d buffer: introduce wlr_buffer_finish() 2025-01-08 16:06:12 +00:00
Simon Ser
b908d865b1 backend: replace get_buffer_caps hook with a struct field
Do the same as wlr_renderer: the supported buffer capabilities are
static for the lifetime of the backend.
2024-12-25 18:40:05 +00:00
Kirill Primak
1c604207c6 seat: don't generate serial 0
0 is reserved to mean "no event has been sent to the client".
2024-12-22 21:33:11 +00:00
Kirill Primak
90530d43fe xdg-dialog-v1: add implementation 2024-12-22 20:46:19 +00:00
Consolatis
c6de47d415 wlr-foreign-toplevel: version guard fullscreen state 2024-12-21 01:20:53 +03:00
Consolatis
bd3724aa26 wlr-foreign-toplevel: convert to stack backed states array 2024-12-21 01:20:53 +03:00
Consolatis
648c64b7e4 wlr-foreign-toplevel: slight refactor 2024-12-21 01:19:17 +03:00
Simon Ser
776f2c4e4d output: adjust warning when hardware cursors are unsupported
We'd print "cursor texture size exceeds hardware limitations" when
some hardware doesn't support cursors at all. Change the message
to better indicate the cause.
2024-12-20 10:39:42 +00:00
M Stoeckl
b97106ddcb wlr_cursor: use default shape if requested shape missing 2024-12-16 15:34:45 +00:00
Simon Ser
71943b3b1e data-device: reset focused surface when destroyed
The surface may be destroyed before the struct wlr_seat_client.

Spotted by Consolatis.
2024-12-11 07:15:02 +00:00
tokyo4j
e21899037a wlr_keyboard: don't emit key event for duplicated keycodes
This fixes the memory leak in wlr_keyboard_group.keys. The leak happened
because wlr_keyboard.keycodes never contains duplicated keycodes while
wlr_keyboard_group.keys can, so calling wlr_keyboard_finish() for all
the wlr_keyboards in wlr_keyboard_group doesn't always free all the keys
in wlr_keyboard_group.keys.
2024-11-28 16:24:57 +00:00
Kirill Primak
c0d4d7217b Add missing destroy events on automatically destroyed objects 2024-11-26 17:49:22 +00:00