Commit graph

10846 commits

Author SHA1 Message Date
Joscha Wloch
af8958ee4f Merge branch 'feature/vkbd_design' into 'main'
Virtual Keyboard: Design Overhaul and Bug Fixes

See merge request wayland/weston!2043
2026-05-04 07:48:24 +00:00
Marius Vlad
689f6bd9ba renderer-gl: Improve accurancy when printing elapsed time
This avoids truncation to zero, by using an explicit cast to float and
print out properly the last 2 digits.

43 / 1000 = 0.00
43 / 1000.0 = 0.04

Fixes: 2d70cbf037

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-05-01 15:39:21 +03:00
Marius Vlad
4e596fca83 renderer-gl: Fix duplicated begin/end timestamps
Fix trivial typo when printing out GPU timeline timestamps.

Fixes: 2d70cbf037

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2026-05-01 15:29:08 +03:00
Derek Foreman
54a25720c6 compositor: Give paint nodes their own flow id
Since a paint node is a combination of surface, view, and output, using
the surface flow in paint node functions can make a confusing twisty mess.

Perfetto flows have in/out degree of one, so we can't properly express the
1 surface to multiple paint nodes relationship with flows.

So for now let's break up the surface and paint node flows, but in the
future we'll have better ways to map multiple flow starts to the same
function via INSTANT events, and we'll be able to better link surface
content update to paint node render.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-29 10:10:08 -05:00
Derek Foreman
8a8cc8486a perfetto: Put the damage event in the flow instead of the clean event.
The Damaged event is the result of a content update application on a
surface. So it makes sense to put this in the flow for the surface.

The Clean event comes from a render completion that could be driven by any
surface, so it doesn't really make sense to consider it part of surface
flow.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-29 10:06:06 -05:00
Derek Foreman
ae2fbb9f9a fifo: Remove unused flow_id
This was never used, and never will be.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-29 09:06:59 -05:00
Leandro Ribeiro
e0c5b8a26b compositor: emit sleep signal
A few custom shells want to know when the compositor is going to sleep.
This adds a new sleep signal and emits it when DPMS is going off.

To showcase the feature, this adds a sleep signal listener to
desktop-shell whose handler logs a message.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-04-22 17:44:29 +03:00
Derek Foreman
fcb0d75d44 vulkan: Support non-axis aligned rotations
We really just need to set the clipper up with the existing function
to get this to work.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-21 17:24:51 +03:00
Derek Foreman
af736168f7 clients: Fix dmabuf feedback stall in simple-vulkan
When we receive dmabuf feedback, we hit the VK_SUBOPTIMAL path and
recreate the swapchain, returning early without submitting work.

However, we've already reset the fence before we do this, so we'll
block forever waiting for work that never comes to signal it.

Instead, we should reset the fence right before we know we're submitting
work.

Fixes: 75c37afa ("clients/simple-vulkan: New Vulkan client example")

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-20 13:11:10 -05:00
Derek Foreman
fc7bb13bbb tests: Skip udmabuf tests before initializing client
We currently leak resources and hit asserts if dmabuf is unavailable.

Move the check to before we initialize anything.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-16 21:17:10 -05:00
Pekka Paalanen
35527e6eed frontend,libweston: remove color_characteristics
Since the commit "color-lcms: extract HDR static metadata from profile"
this was all dead code.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-04-16 13:46:22 +00:00
Pekka Paalanen
dbdb5f92f2 color-lcms: extract HDR static metadata from profile
Extract the HDR static metadata type 1 from the output color profile
directly, instead of relying on a separate weston.ini section to provide
the metadata separately.

Weston should tell the monitor what target color volume it is rendering
for. I don't see a reason to be able to control the metadata separately,
and it would add complexity.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-04-16 13:46:22 +00:00
Derek Foreman
8872d5ee14 frontend: Fix superficial bug in VRR handling
We should just return 0 on success, not return some enum with
a value that happens to be initialized to something that resolves
to 0.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-15 15:50:39 -05:00
Joscha.Wloch
e37c64bc0d desktop-shell: Even if input is already mapped recalculate position
Otherwise when keyboard layout changes it gets positioned wrong.

Signed-off-by: Joscha.Wloch <Joscha.Wloch@bruker.com>
2026-04-15 06:22:40 +00:00
Joscha.Wloch
a3a8cf0cf4 clients: keyboard: fix backspace deleting two characters with qt
The implementation of the
'zwp_input_method_context_v1_delete_surrounding_text' function in
'qtwayland' interprets the first index parameter as the number of
characters to be deleted before the cursor and the second as the number
of characters to be deleted after the cursor.
In the current implementation of the keyboard, this means that if the
cursor is between two characters, both the character before the cursor
and the character after the cursor are deleted.
As only the character before the cursor is to be deleted, it is
sufficient to pass a '0' as the second parameter.

Deleting a character at the end of the preedit string now also
takes UTF-8 characters into account.

Signed-off-by: Joscha.Wloch <Joscha.Wloch@bruker.com>
2026-04-15 06:22:40 +00:00
Joscha.Wloch
589f92d883 clients: keyboard: minor code improvements
Signed-off-by: Joscha.Wloch <Joscha.Wloch@bruker.com>
2026-04-15 06:22:40 +00:00
Joscha.Wloch
cfcfc15554 clients: keyboard: fix key remains visually in pressed state
If you pressed a key and then moved your finger to another position
without lifting it, the key remained visually pressed even after you
lifted your finger. Now the ID is stored for each touch event and as
soon as a release event returns, the corresponding key is put back into
the correct state.

Signed-off-by: Joscha.Wloch <Joscha.Wloch@bruker.com>
2026-04-15 06:22:40 +00:00
Joscha.Wloch
e0bfeb4f8f clients: keyboard: fix resize on layput change
If the content type changes, then the layout also changes, which means
that the size must be adapted to the new layout and the widget must
be redrawn.

Signed-off-by: Joscha.Wloch <Joscha.Wloch@bruker.com>
2026-04-15 06:22:40 +00:00
Joscha.Wloch
74a7484ae6 clients: keyboard: Prevent NULL context in 'keyboard_handle_key'
It can happen that the input context is exited between a key press event
and a key release event, as a result it is set to NULL. If the
'keyboard_handle_key' function is called in this case, this leads to a
crash. To prevent this, the context is checked beforehand.

Signed-off-by: Joscha.Wloch <Joscha.Wloch@bruker.com>
2026-04-15 06:22:40 +00:00
Joscha.Wloch
366d11c3ee clients: window & keyboard: Be able to set the minimum allocation
Function added to be able to set the minimum allocation of the window.

Set the minimum allocation of the keyboard window manually.
Otherwise, the first call to 'window_schedule_resize' sets
'min_allocation' to the size of the current layout.
This means that a layout that requires less space no
longer has the chance to use the correct allocation size.

Signed-off-by: Joscha.Wloch <Joscha.Wloch@bruker.com>
2026-04-15 06:22:40 +00:00
Joscha.Wloch
90e54338d7 clients: keyboard: changed numpad layout
Changed the numeric keys layout to create an easier to use numpad.
Adds Numpad floating point number input with checks that such a number
always has at max one decimal point.

Signed-off-by: Joscha.Wloch <Joscha.Wloch@bruker.com>
2026-04-15 06:22:40 +00:00
Torben Hohn
d728ee0c1d keyboard: Hardcode font from bold to normal weight
this should also be configurable.

Signed-off-by: Torben Hohn <torben.hohn@bruker.com>
2026-04-15 06:22:40 +00:00
Torben Hohn
b1ab447d0d Adjust keyboard layout with diagonal keys
Signed-off-by: Torben Hohn <torben.hohn@bruker.com>
2026-04-15 06:22:40 +00:00
Torben Hohn
0ced2d5eb2 clients: keyboard: Add per key state and color rendering
Add 2 helper functions for the rendering update.

Signed-off-by: Torben Hohn <torben.hohn@bruker.com>
2026-04-15 06:22:40 +00:00
Torben Hohn
9375cbbbf9 clients: keyboard: increase key_heigth to make the keys square
Signed-off-by: Torben Hohn <torben.hohn@bruker.com>
2026-04-15 06:22:40 +00:00
Torben Hohn
26258b348f clients: keyboard: Implement config
Allow configuring the look of the keyboard.
This patch does not make use of the colors.

Without configuration nothing should change to the old default look.

Signed-off-by: Torben Hohn <torben.hohn@bruker.com>
2026-04-15 06:22:40 +00:00
Torben Hohn
f30eb47b04 clients: keyboard: Implement keytype_none
Allow empty space in the keyboard matrix by adding keytype_none.
This is effectively a NOP. Nothing happens when this key is pressed
and its not even drawn.

Signed-off-by: Torben Hohn <torben.hohn@bruker.com>
2026-04-15 06:22:40 +00:00
Torben Hohn
1ddc493a52 clients: keyboard: Prepare for half width keys: halve keywidth
Prepare to make the keyboard layout more realistic by allowing
half width granularity with the keys.

Multiply all width realted values by 2 and divide key_width by 2.
This commit should not change the appearance of the keyboard.

Signed-off-by: Torben Hohn <torben.hohn@bruker.com>
2026-04-15 06:22:40 +00:00
Derek Foreman
978052f9ed drm: Use weston_log_scope_puts when we don't have a format string
We can use __VA_OPT__ to make a macro that automatically selects between
the puts and printf log scope variants.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-14 17:12:05 +03:00
Derek Foreman
ec5a7ee8fe log: Add weston_log_scoped_puts()
In case we want to write an entire string without formatting.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-14 17:12:05 +03:00
Pekka Paalanen
2a7288e70e tests/buffer-transforms: reduce split cases
The point of buffer_transform_split is to ensure that committing only
transform and scale changes gets reflected on screen, without explicit
damage. There is no need to go through the big set of parameter
combinations, it only needs to test that changing each triggers the
damage.

Test setting only scale and only transform separately, so that one
cannot mask bugs with the other.

This brings the screenshot count for buffer_transform_split from 12 down
to 2, which is good for CI running time.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-04-10 12:03:43 +03:00
Pekka Paalanen
3ce5a2e774 tests/output-damage: doc renderer testing
This test was originally written to ensure Weston does not repaint too
much, but it does also test that renderers transform the damage
correctly into the framebuffer.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-04-10 11:51:05 +03:00
Derek Foreman
0024857086 pixman-renderer: Remove weston_view from repaint_region
We now have the view alpha cached in the paint node, so we can get it
from there.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
7dcf887903 renderers: use pnode view_alpha everywhere
Don't look this up from the weston_view anymore.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
77eb13f499 drm,renderers: Remove some unnecessary indirection
pnode->view->surface is the same as pnode->surface, always.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
3ff456175a gl-renderer: Log paint node internal name instead of view
Continuing my quest to remove weston_view from backends and renderers,
drop gl-renderer's last use of weston_view.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
22bcfead57 compositor: Add a weston_coord_global_to_surface_for_paint_node and use it
Add compositor code to handle this so the gl-renderer can reference just
the paint_node.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
f5fb552b57 drm: Fix stale comment that refers to weston_view
This is passed a weston_paint_node, not a weston_view.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
6a06562b77 drm: Rename find_plane_for_view
We're passing a paint node already, so let's just change the name.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
1ec218026a compositor: Store view alpha in the paint node
This is one of the few things backends and renderers still need to grab
from the view.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
d85618a029 drm: rename node to pnode in drm_output_find_plane_for_view
Cosmetic meddling.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
a0f860ad70 drm: Stop using weston_view in drm_assign_planes
We can get all these things from surface through paint node.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
501f6d31b1 drm: Stop using weston_view in try_paint_node_on_plane
We've removed all need for this now.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
9042fd41d7 drm: Store paint node instead of view in plane state
The paint_node life cycle should match the output's, so we should be able
to store it in the state instead of a view.

This gets us closer to having the backends stop caring about views.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
6f09ba42bd compositor: Add cursor layer status to paint nodes
Store this in the paint node so we don't have to look it up in the view
in the backends.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
838d6d92be drm: Don't use weston_view in drm_output_find_plane_for_view
We can get what we need via the paint node.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
c1fcfd288d drm/state-propose: remove output asserts in z_order_list walks
We already validate the paint node list in weston_output_repaint,
immediately after we conditionally rebuild the z_order_list.

These asserts are thus completely redundant, as we've already
performed them in the front end.

My reason for removing this now is to drop weston_view usage
from the backend.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
96676d114c drm: Don't use weston_view in drm_fb_get_from_paint_node
We have no need for a weston_view here.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
3c53883d78 drm: Use is_fully_opaque from paint node in drm_fb_get_from_paint_node
The paint node early update has already checked this value for us, we
should use that instead of interacting with the view.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00
Derek Foreman
9022976412 drm: Log paint node internal names instead of view internal names
Backends work on paint nodes, not views - and the paint node internal
name is a superset of the view internal name anyway, so it's not hard to
figure out which view a paint node belongs to when reading debug text.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:58:15 -05:00