Commit graph

10833 commits

Author SHA1 Message Date
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
Derek Foreman
ef5164aa06 drm: Pass a paint node to dmabuf_feedback_maybe_update
The failure reason is already part of the paint node, so passing the view
here just makes things a little bit more complicated.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:40:04 -05:00
Derek Foreman
300c41858c drm: Use surface from paint node in drm_fb_get_from_paint_node
One fewer reasons to keep use the weston_view.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:40:04 -05:00
Derek Foreman
6169657e24 vnc: Don't use weston_view
We've got a pnode, use that instead.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:40:03 -05:00
Derek Foreman
b3d18455dd drm: Change node to pnode in drm_output_prepare_cursor_paint_node
Cosmetic meddling.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:40:03 -05:00
Derek Foreman
dd88c1fddd drm: rename node to pnode in drm_output_try_paint_node_on_plane
Cosmetic meddling.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:40:02 -05:00
Derek Foreman
febd93e4da compositor: Replace view_has_valid_buffer with paint_node_had_valid_buffer
Backends should be relying on paint nodes for their information, not
views.

Since we always have a paint node when we want to pass a buffer, we can
pass that instead of a view.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:39:58 -05:00
Derek Foreman
f4a56f057f drm: Pass paint node to drm_fb_compatible_with_plane
The backends shouldn't care about views as much as they do,
so pass the paint node.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:38:03 -05:00
Derek Foreman
69efa21e08 drm: Pass paint node to cursor_bo_update
This doesn't need anything view related, and we already have the node.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2026-04-09 08:38:03 -05:00
Pekka Paalanen
22db719484 frontend: default color-profile to auto:
Now that ICC<->parametric image description interoperability is
implemented, and the stock sRGB profile is parametric, we can change the
default to what it should be.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-04-09 13:00:26 +00:00
Pekka Paalanen
a5ffb96d23 color-lcms: adjust supported TF mask
TF_SRGB will be deprecated, best to never advertise it. The test can
simply use gamma22 instead.

TF_EXT_LINEAR has an implementation and should be usable nowadays.
TF_ST2084_PQ, GAMMA22 and GAMMA28 likewise.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-04-09 13:00:26 +00:00
Pekka Paalanen
e9c388b5a1 color-lcms: do not advertise saturation intent
Weston does not support the saturation rendering intent for parametric
image descriptions yet. Not really, Weston would just do the same as
media-relative with BPC does.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-04-09 13:00:26 +00:00
Pekka Paalanen
63e58c47e4 color-lcms: switch default sRGB profile to parametric
This avoids ICC paths when no ICC profiles are explicitly used.

We can simplify the profile information sending and use the generic path
for the stock profile as well, no longer hard-coding the stock profile
in two places.

Since the stock profile creation cannot fail, we can streamline
cmlcms_init() a little, too.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-04-09 13:00:26 +00:00
Pekka Paalanen
54b60ad51a color-lcms: optimize linear TRCs
The icc<->parametric color transformation code uses "optical ICC
profiles" as part of the ICC pipeline. These profiles use a linear TRC
to encode the black point. When such TRC survives all optimizations, it
will cause the 3D LUT fallback path to be taken.

Detect such curve sets on the ICC pipeline optimizer, and convert them
to matrix stages. The matrix stages will then be optimized as usual,
often eliminating the stage completely.

The results can be seen in color-icc-output test after the stock sRGB
profile has been changed into a parametric one, causing all cases in the
test to hit the parametric-to-icc path. Some tests fail when they
suddenly start using the 3D LUT path which causes the errors to rise.
This patch fixes those (future) cases, and the errors remain the same as
before changing the stock profile.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2026-04-09 13:00:26 +00:00