Commit Graph

1904 Commits

Author SHA1 Message Date
Simon Ser d483dd2f4c output: add wlr_output_commit_state
Same as wlr_output_commit, but takes a wlr_output_state.
2022-05-30 11:40:34 +02:00
Simon Ser 501ac5398d output: add output_state_{init,finish} 2022-05-30 11:40:34 +02:00
Simon Ser b21c26a1c9 output: add wlr_output_event_precommit.state 2022-05-30 11:34:57 +02:00
Simon Ser c4253fef9c output: add wlr_output_test_state
Same as wlr_output_test, but takes a wlr_output_state argument.
2022-05-30 11:34:57 +02:00
Simon Ser 9e25d3074d output: pass wlr_output_state to rendering functions
No functional change.
2022-05-30 11:34:57 +02:00
Simon Ser 927661d246 output: pass wlr_output_state to output_pending_resolution 2022-05-30 11:34:57 +02:00
Simon Ser 25dd3cc0cd output: pass wlr_output_state to backend
Groundwork for the following commits. The goal is to allow users
to specify their own wlr_output_state instead of wlr_output.pending.
2022-05-30 11:34:57 +02:00
Kirill Primak c1ec71903c xdg-shell: bump version to 3 2022-05-27 13:31:30 +00:00
Kirill Primak 1761c3bbe2 xdg-popup: add reposition support 2022-05-27 13:31:30 +00:00
Kirill Primak 8a0835c59c xdg-positioner: add v3 parameters 2022-05-27 13:31:30 +00:00
Kirill Primak 6f1fce9cb4 xdg-popup: use current/pending state pattern 2022-05-27 13:31:30 +00:00
Kirill Primak 4a968576e4 xdg-popup: add proper configure flow 2022-05-27 13:31:30 +00:00
Simon Ser 4d7f1aeb73 linux-dmabuf-v1: fix MOD_INVALID handling in feedback tranches
[1] has changed wlr_drm_format to remove the assumption that
MOD_INVALID is always implicitly enabled. MOD_INVALID is now part
of the modifier list just like any other modifier.

The patch adding support for linux-dmabuf-v1 feedback has been
written a lot of time before [1], and hasn't been updated accordingly
when merged. This results in MOD_INVALID being advertised twice [2] and
other index bugs.

Fix these issues by removing special-casing for MOD_INVALID.

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3231
[2]: https://github.com/swaywm/sway/issues/7028
2022-05-26 13:45:24 +00:00
Simon Ser be86145322 output: turn make/model/serial into char *
This allows the make/model/serial to be NULL when unset, and allows
them to be longer than the hardcoded array length.

This is a breaking change: compositors need to handle the new NULL
case, and we stop setting make/model to useless "headless" or
"wayland" strings.
2022-05-26 13:36:06 +00:00
Alexander Orzechowski 41124592dd wlr_scene: Hook up HIGHLIGHT logic
This will display red translucent rectangles on the screen regions that
have been damaged. These rectangles will fade out over the span of 250
msecs. If the area is damaged again while the region is fading out,
the timer is reset.

Let's also disable direct scan out when this option is enabled, or else
we won't be able to render the highlight damage regions.
2022-05-23 15:58:49 -04:00
Alexander Orzechowski b6fc882782 wlr_scene: Hook up RERENDER logic 2022-05-23 15:43:18 -04:00
Alexander Orzechowski 17f5414b1a wlr_scene: Parse out WLR_SCENE_DEBUG_DAMAGE 2022-05-23 15:43:18 -04:00
Manuel Stoeckl 9cae874513 screencopy-v1: Fix frame stride for formats with bpp != 32 2022-05-23 07:37:24 +00:00
Kirill Primak ee122c9c2a scene/output: check for NULL in destructor 2022-05-23 07:33:49 +00:00
Guido Günther 17b2b06633 seat: Allow to cancel touches
After cancelation we destroy the touch points associated with this
surface as the Wayland spec says:

No further events are sent to the clients from that particular gesture.
Touch cancellation applies to all touch points currently active on this
client's surface. The client is responsible for finalizing the touch
points, future touch points on this surface may re-use the touch point
ID.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/2999
2022-05-22 09:43:33 +00:00
Alexander Orzechowski dc9bc5683a wlr_scene: Refactor wlr_scene_surface to be a helper on top of wlr_scene_buffer 2022-05-19 14:26:50 -04:00
Alexander Orzechowski 5f43e1732a wlr_scene: Introduce addons to scene nodes 2022-05-19 14:25:34 -04:00
Alexander Orzechowski 20cc1ce0b9 wlr_scene: Change out surface specific iterator functions
Instead iterate over wlr_scene_buffer
2022-05-19 14:24:05 -04:00
Alexander Orzechowski 5f56246571 wlr_scene: Pull scene_node_get_root into a private header
We will need this for surface emulation on buffers.
2022-05-19 14:24:05 -04:00
Alexander Orzechowski 39c059b70e wlr_scene: Make scene_buffer_from_node public 2022-05-19 14:24:05 -04:00
Alexander Orzechowski 73a656e8ac wlr_scene: Add a function to also specify damage when applying a buffer to wlr_scene_buffer 2022-05-19 14:24:05 -04:00
Alexander Orzechowski 34be5da072 wlr_scene: Add a way to choose when input interactions happen on a buffer 2022-05-19 14:24:05 -04:00
Alexander Orzechowski 09c7fe0f90 wlr_scene: Add frame_done signal for wlr_scene_buffer
Let's also change the name of the function. Motivation [1].

[1] https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3496#note_1357824
2022-05-19 14:23:10 -04:00
Alexander Orzechowski a53eccf2af wlr_scene: Add primary_output property to wlr_scene_buffer 2022-05-19 14:21:22 -04:00
Alexander Orzechowski dfeb1309a8 wlr_scene: Add presentation signal for wlr_scene_buffer 2022-05-19 14:21:21 -04:00
Alexander Orzechowski 7e383c6a6a wlr_scene: Make wlr_scene_render_output private
This function sidesteps damage tracking and output awareness on
buffers/surfaces. This function isn't a great fit for the API.

Let's also inline the function and simplify it.
2022-05-19 14:17:51 -04:00
Alexander Orzechowski 933ff0e60c wlr_scene: Fix missing calls to scene_node_update_outputs
There were a couple places this was missing
 - on mode change of an output. If the resolution changes for example
   nodes may fall out of the view.
 - on commits on an output for scale or transform changes
 - when the transform of a buffer is changed. If the dest size is not
 set, the buffer may have been rotated potentially changing its size
 if the buffer width != height
2022-05-19 14:17:51 -04:00
Alexander Orzechowski c46b53d0b0 wlr_scene: Add output_enter/output_leave signals
When we destroy a scene buffer, let's make sure that we call
output_leave signals before we finish the node which will call destroy
listeners.
2022-05-19 14:17:51 -04:00
Alexander Orzechowski 6ddb9e51bd wlr_scene_output: Send output leave events before destroying the output 2022-05-19 14:17:51 -04:00
Alexander Orzechowski 61dab42c70 wlr_scene: Add setter for buffer of a wlr_scene_buffer 2022-05-19 14:17:51 -04:00
Alexander Orzechowski 039a31df9a wlr_scene: Allow buffer in wlr_scene_buffer to be NULL
This is useful to emulate an unmapped surface.
2022-05-19 14:16:52 -04:00
Simon Ser 8fe3aa29da xdg-shell: specify version in wlr_xdg_shell_create
With protocol additions such as [1], compositors currently have no
way to opt out of the version upgrade. The protocol upgrade will
always be backwards-compatible but may require new compositor
features.

The status quo doesn't make it possible to ship a protocol addition
without breaking the wlroots API. This will be an issue for API
stabilization [2].

To address this, let compositors provide a maximum version in the
function creating the global. We need to support all previous versions
of the interface anyways because of older clients.

This mechanism works the same way as Wayland clients passing a version
in wl_global.bind.

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3514
[2]: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1008

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3397
2022-05-15 15:44:40 +00:00
Kirill Primak 8b0d4947cc xdg-toplevel: store states on the stack 2022-05-10 19:19:08 +03:00
Simon Ser 410c08cdc6 drm-lease-v1: skip device on wlr_drm_backend_get_non_master_fd failure
On some setups, wlr_drm_backend_get_non_master_fd may fail because
of permission issues. Instead of exposing a bogus global, bail out.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3391
2022-05-02 15:44:16 +00:00
Simon Ser 6c350799b2 Zero-initialize structs in init functions
Ensures there is no field left to its previous undefined value after
calling an init function.
2022-04-28 10:09:50 +02:00
Ferdinand Bachmann d3a2ea33e5 types/seat/wlr_seat.c: fix focused_client being null after seat_client recreation 2022-04-16 20:56:30 +02:00
Ferdinand Bachmann 2d4e813530 types/wlr_pointer_gestures_v1.c: get client from seat client instead of resource 2022-04-16 20:53:52 +02:00
Ferdinand Bachmann eedb9df531 types/wlr_pointer_gestures_v1: null-check both focused_surface and focused_client
(fixes #3385)
2022-04-15 16:06:16 +02:00
Kirill Primak 4ba8458255 scene/output-layout: fix scene destroy handler 2022-04-14 06:51:39 +00:00
Kirill Primak dec2565f2b xdg-toplevel: don't schedule configures on state requests 2022-04-13 17:00:06 +00:00
Kirill Primak 04aa44b4df xdg-foreign-v2: treat unmapped parents as NULL 2022-04-13 16:48:15 +00:00
Kirill Primak dac040f87f xdg-foreign-v1: treat unmapped parents as NULL 2022-04-13 16:48:15 +00:00
Kirill Primak bf3f60ff73 xdg-toplevel: treat unmapped parents as NULL 2022-04-13 16:48:15 +00:00
Guido Günther dd03d839ab xdg-activation: Deduplicate token creation code
There were three places initializing a token:

- wlr_xdg_activation_v1_add_token
- wlr_xdg_activation_token_v1_create
- activation_handle_get_activation_token

The initialization of the token.destroy was missing in the first one. To
prevent these functions from getting out of sync move the token creation
into a common function.

Fixes 4c59f7d4 ("xdg-activation: Allow to submit tokens")
2022-03-26 17:28:51 +01:00
Leonardo Hernández Hernández 4519117a68 seat: take wlr_keyboard in wlr_seat_set_keyboard()
Signed-off-by: Leonardo Hernández Hernández <leohdz172@protonmail.com>
2022-03-23 13:08:41 +00:00