Commit graph

7579 commits

Author SHA1 Message Date
xurui
db2c907f93 xwayland/selection/dnd: always send finished event
Signed-off-by: xurui <xurui@kylinos.cn>
2025-03-23 15:17:10 +01:00
Thomas Frans
221bc5f6aa
git: fix incorrect subprojects ignore in .gitignore
Ignoring the entire `/subprojects/` directory prevents the next rule
from including just the Meson wrap files. Instead, ignore all the files
in the directory which allows the intended behavior.
2025-03-23 13:24:15 +01: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
Chris Ever
ba7ac3efe5
fix comment typo in wlr_text_input_v3.h
fixes #3951
2025-03-15 00:11:47 +08:00
Kenny Levinsen
954dba3968 xwayland: Reset signal mask and handlers before exec
Certain signal-related properties, such as the signal mask and handlers
that are set to ignore, are not reset by exec and therefore affect the
new process image.

In case of Xwayland, a compositor setting SIGCHLD to SIG_IGN causes
keyboard compilation to fail as it expects waitpid to work by default.

Reset the signal mask and the two signals that sway is known to set.
2025-03-13 01:37:20 +01:00
Simon Ser
50edd3a42d Document config.h 2025-03-10 15:02:26 +00:00
liupeng
31f9d6bb97 screencopy-v1: drop output_enable listener 2025-03-10 15:33:46 +08:00
Simon Ser
94cb8e2bc7 backend/drm: fix enabling an output with a custom mode set
Since 5567aefb1c ("backend/drm: Don't add pollute fixed modes
list with custom modes"), when a custom mode is set on an output,
current_mode will be NULL.

Instead of checking current_mode, check width/height.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3946
2025-03-07 13:00:06 +00:00
Simon Ser
ca1f9f86e6 backend/drm: handle custom modes in connect_drm_connector()
On startup, some connectors might be already lit up with a custom
mode. We weren't correctly populating the current output state in
this case.
2025-03-07 13:00:06 +00:00
Simon Ser
08c74f36a9 xwayland/xwm: log when property type is invalid 2025-03-06 15:22:49 +01:00
Simon Ser
5175b6e94e xwayland/xwm: handle deleted properties
X11 clients might delete window properties. In that case, reset
our state to the initial value.
2025-03-06 15:21:13 +01:00
Guido Günther
e752e3ec06 xwm: Handle NET_WM_WINDOW_OPACITY
Lot of clients use it (e.g. both Qt and GTK) although it never made it
into the spec at

  https://specifications.freedesktop.org/wm-spec/latest-single/

until recently

  https://gitlab.freedesktop.org/xdg/xdg-specs/-/merge_requests/97

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-06 14:18:20 +00: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
Simon Ser
3505079823 ci: fetch gyosu from new upstream
gyosu has moved to Codeberg.
2025-03-06 10:32:09 +01: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
Kirill Primak
b13fe9b3a1 backend/wayland: use a separate event queue for busy loops
This avoids processing events which we're not interested in.
Specifically, this fixes a case where output_commit() could be
indirectly called from itself either from import_dmabuf() or while
waiting for a configure event when enabling the output.
2025-03-01 16:03:52 +00:00
Kirill Primak
35ff09a754 backend/output: extract backend to a variable in output_commit() 2025-03-01 16:03:52 +00:00
Kirill Primak
90b5f0dde5 backend/wayland: don't send request_state when enabling an output 2025-03-01 16:03:52 +00:00
Simon Ser
e83b06e732 render/vulkan: unify alpha pre-multiplication in output shader
Instead of handling alpha pre-multiplication in each branch, add
some common logic before and after handling OUTPUT_TRANSFORM.
2025-02-23 15:41:23 +01: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
David Turner
1380a48b4d Declare struct wlr_surface in a less weird place
wlr_compositor.h contains references to `struct wlr_surface` in function
arguments before it actually defines it.  This generally works because
wlr_compositor.h includes wlr_output.h which contains a
forward-declaration for `struct wlr_surface` (despite not actually
referencing it).

This is all pretty weird, and gives very confusing errors if you manage
to end up with wlr_output.h including wlr_compositor.h (eg. via an
indirect route) so make it less weird.
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
edd8df76d8 Bump required w-p version to 1.40
Signed-off-by: James Ramsey <james.jehiel.ramsey@gmail.com>
2025-02-14 18:57:37 +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
714a0264a6 ci: generate and publish HTML documentation 2025-01-31 15:27:03 +00:00
Simon Ser
a64e1a58b1 backend/drm: log when creating multi-GPU renderer
Creating a renderer results in lots of logs. Make it clear that
the logs belong to a multi-GPU renderer (as opposed to a primary
renderer created by the compositor).
2025-01-30 02:10:58 +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
a818251aec render/pixman: drop cast for pixman_image_set_clip_region32()
The new Pixman release has made this const.
2025-01-29 23:33:50 +01:00
Simon Ser
0d056a0315 util/matrix: remove unnecessary include 2025-01-27 17:50:18 +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
c1eb053f5e render/drm_syncobj: Remove the ready signal from timeline_waiter
It's unused.
2025-01-26 18:02:14 -05: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
fa97f7f1f0 buffer: Move wlr_buffer_is_opaque to public header
Fixes: 1ee3ed43 ("buffer: Make wlr_buffer_is_opaque public")

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-01-26 00:17:40 +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
1c2cb4c802 drm-syncobj: return false instead of NULL 2025-01-24 21:57:28 +03:00
Kirill Primak
4f6dd01e5a backend/wayland: remove syncobj waiter on buffer destroy 2025-01-24 21:46:31 +03:00
Kirill Primak
980ac9e4c8 CONTRIBUTING.md: mention listener list assertions 2025-01-20 16:17:12 +03: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
f95270bb5e pointer-constraints: rewrite doc comments 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
llyyr
9ab87167b5 backend/drm: don't leak mgpu_formats 2025-01-16 14:58:59 +00:00