Commit Graph

9710 Commits

Author SHA1 Message Date
Jonas Ådahl 10ecf60848 xdg-shell: Allow poup grab on non-grabbing popup
Grabbing requires a single chain of grabbing popups, but it doesn't require
grabbing to start with a toplevel, it could just as well start with a
non-grabbing popup.

Avoid seding an error when a client attempts to do this.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2024-11-06 10:43:27 +02:00
Alexey Yerin d30683341c clients: don't redraw on xdg_toplevel.configure
Signed-off-by: Alexey Yerin <yyp@disroot.org>
Signed-off-by: Kirill Primak <vyivel@eclair.cafe>
2024-11-06 10:12:51 +02:00
Derek Foreman 1ee1b93bac desktop-shell: Don't crash if the output is removed in startup
If the output is destroyed between setting the panel and committing the
panel, or between setting the background and committing the background,
we have a use after free crash.

Handle this by clearing the surface private pointers on output destroy
so we can skip the useless commits.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-11-05 11:29:39 -06:00
Marius Vlad fe35be5013 gitlab-ci: Bump libdrm to 2.4.118 to add NV{15,20,30} fmts
And add ifndef guards for cases were do have support for it.

While at it I need to change how we build it due to:

'meson.build:21:0: ERROR: Value "false" (of type "string") for combo
option "Enable support for vc4's KMS API." is not one of the choices.
Possible choices are (as string): "enabled", "disabled", "auto".'

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-11-04 16:40:46 +02:00
Leandro Ribeiro a3fd8f3c97 color-lcms: accept ICC profiles of device class ColorSpace
From "color: update color-management protocol to xx-v4" onwards, we
should accept ICC profiles of device class ColorSpace, as the CM&HDR
protocol says. So do that.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-11-04 13:13:22 +00:00
Daniel Stone 8fdc55c03f pixel-formats: Add NV15/20/30 YUV 10bpc formats
NV15/20/30 are a family of 10bpc YUV formats which have 4
horizontally-adjacent samples packed into a 40-bit cluster. The
difference between 15/20/30 is in the subsampling.

No fallbacks are provided, as there is no format pairing which would
allow us to sensibly unpack the clusters.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2024-11-01 15:05:28 +00:00
Derek Foreman 16dc3b2b7f clients/simple-egl: simplify wait for configure loop
Just move the init function outside of the loop and we can drop the
if/continue.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-10-21 10:46:27 +00:00
Marius Vlad 80e47a7161 libweston/desktop: Avoid a potential crash on invalid resource
This checks for a valid resource when getting a xdg_popup. Similar to
the check in get_toplevel.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-10-21 11:14:48 +03:00
Marius Vlad 8b5bb588df libweston/desktop: Don't destroy the xdg_surface
Upon xdg_toplevel::destroy we seem to be calling xdg_surface::destroy
destroy handler. Protocol states that we should umap the surface with
client having the posibility to getting another toplevel role for the
same xdg_surface and re-map the window.

This also adds a guard for an unlikely invalid resource.

Fixes: #774

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-10-21 11:14:46 +03:00
Marius Vlad a501acd291 libweston/matrix: Fix narrow conversion with C++
Fixes the following C++ narrow conversion:

/include/libweston-14/libweston/matrix.h: In function ‘weston_coord
weston_coord_truncate(weston_coord)’:
/include/libweston-14/libweston/matrix.h:212:39: error: narrowing
conversion of ‘(int)in.weston_coord::x’ from ‘int’ to ‘double’
[-Werror=narrowing] 212 |         return (struct weston_coord){
	(int)in.x, (int)in.y };
      |                                       ^~~~~~~~~
/home/mvlad/install-new/include/libweston-14/libweston/matrix.h:212:50:
error: narrowing conversion of ‘(int)in.weston_coord::y’ from ‘int’ to
‘double’ [-Werror=narrowing] 212 |         return (struct weston_coord){
	(int)in.x, (int)in.y };

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-10-18 20:40:56 +03:00
James Le Cuirot 9a536962a5
tests: Make some tests dependent on the shell-desktop option
The internal-screenshot and text tests are dependent on the feature and
fail with it disabled.

Signed-off-by: James Le Cuirot <chewi@gentoo.org>
2024-10-14 22:47:13 +01:00
James Le Cuirot 486d96a162
tests: Make the kiosk test dependent on the shell-kiosk option
The test is dependent on the feature and fails with it disabled.

Signed-off-by: James Le Cuirot <chewi@gentoo.org>
2024-10-14 22:46:34 +01:00
Marius Vlad 217fb30847 desktop-shell: Don't attempt to re-add the view to panel layer
This change fixes a side-effect of weston_view_move_to_layer helper
which would basically unmap the view because the layer entry list is no
longer visible. Only add the view to panel layer the first time.

Fixes: #956

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-10-11 11:36:03 +03:00
Jeri Li 04f27f1be2 libweston/desktop: avoid weston crash while xdg_surface ack_configure
checks the resource and sends a protocol error if the client tries to
send a request to an inert object then returns out of the request
handler

Signed-off-by: Jeri Li <jeri.li@mediatek.com>
2024-10-11 11:22:21 +03:00
Marius Vlad 68bbc4cf51 libweston: Move weston_get_backend_type after enum declaration
Fix: #951

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-10-10 07:56:59 +00:00
Jan Engelhardt f86ff8c07d build: insert missing wayland-server-protocol dependency
A new build error sprung up in weston-14 compared to 13.0.0.
Fix it.

FAILED: tests/liblib_lcms_util.a.p/lcms_util.c.o
cc -Itests/liblib_lcms_util.a.p -Itests -I../tests -I. -I.. -Iinclude
-I../include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall
-Winvalid-pch -Wextra -Wpedantic -std=gnu99 -Wmissing-prototypes
-Wno-unused-parameter -Wno-shift-negative-value
-Wno-missing-field-initializers -Wno-pedantic -Wundef
-fvisibility=hidden -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3
-fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables
-fstack-clash-protection -Werror=return-type -flto=auto -g -fPIC -MD
-MQ tests/liblib_lcms_util.a.p/lcms_util.c.o -MF
tests/liblib_lcms_util.a.p/lcms_util.c.o.d -o
tests/liblib_lcms_util.a.p/lcms_util.c.o -c ../tests/lcms_util.c
In file included from ../tests/lcms_util.c:35:
../include/libweston/matrix.h:33:10: fatal error:
wayland-server-protocol.h: No such file or directory

   33 | #include <wayland-server-protocol.h>

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2024-10-08 19:36:09 +02:00
David Edmundson fe64eee3ae libweston: Send seat name before announcing devices
Clients need to know the seat name at the time they create mouse and
keyboard objects. This brings Weston in line with other compositors.

The documentation upstream currently is not super clear. It states name
is explicitly sent on bind, capabilities don't mention being sent on
bind in any way.

Signed-off-by: David Edmundson <davidedmundson@kde.org>
2024-09-26 13:28:30 +00:00
EatingSumo 312c8bea66 libweston/screenshooter: Fix build when __builtin_clz is not available
Fix compilation error when `__builtin_clz` is not available by renaming variable 'u' to 'run'

Signed-off-by: Junyu Long <877730493@qq.com>
2024-09-26 13:17:27 +00:00
Derek Foreman 067e977fe1 desktop-shell: Don't try to move parented views on output removal
These should be repositioned relative to their parents, attempting to
move them independently not only doesn't make sense, but violates
weston_coord sanity checks.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-09-18 09:13:19 -05:00
Jan Alexander Steffens (heftig) 0e451e8dc3
libweston/noop-renderer: Check shm_buffer for NULL
Copy the check from the pixman renderer.

Fixes: https://gitlab.freedesktop.org/wayland/weston/-/issues/953
Signed-off-by: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
2024-09-14 06:38:47 +02:00
Derek Foreman 2e51def212 libdisplay-info: Bump wrap version
We need libdisplay-info 0.2.0 for some features, but our wrapper
currently builds 0.1.1, leading to some surprising errors when
trying to use those features.

Bump the wrap version so if we're pulling this in from a wrap
we get the latest features.

We leave the hard dependency alone for now, as it's still not
widely deployed.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-09-13 09:43:04 -05:00
Joan Torres a266c5fff5 clients: Add color
Add a client that creates a surface with one color using single pixel buffer.

Set to that surface an image_description created with the parametric creator of
the color management protocol.

This client can get as params:
  1. Width and height
  2. Color channels R, G, B, A
  3. The name of primaries
  4. The name of a transfer function
  5. The min, max, ref luminance levels

Signed-off-by: Joan Torres <joan.torres@suse.com>
2024-09-09 13:51:51 +00:00
Joan Torres 53419eb991 clients/window: Allow rendering frame wihout shadow
Rendering the shadow currently renders some dark color near the border inside
the inner content.

Altough the content is on top of it, if the content has some transparency,
that dark color appears and this might be unwanted.

Add an option to not render the shadow to avoid that problem.

Signed-off-by: Joan Torres <joan.torres@suse.com>
2024-09-09 13:51:51 +00:00
Marius Vlad e026fd6540 meson.build: reopen main for regular development
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-09-04 12:12:34 +03:00
Marius Vlad 60981998b2 build: bump to version 14.0.0 for the official release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-09-04 11:53:50 +03:00
Marius Vlad 186937dc95 build: bump to version 13.0.95 for the RC3 release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-09-02 10:56:26 +03:00
Derek Foreman 50d92f9d6f libweston: Fix crash with mirror-of
Since c4eb15d453 we keep a copy of
native mode parameters, however we forgot to initialize the
native mode parameters in some situations, which breaks the
output mirroring code when it sees uninitialized data.

Fixes c4eb15d453
Fixes #949

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-08-30 08:16:45 -05:00
Marius Vlad f81c0358c5 build: bump to version 13.0.94 for the RC2 release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-30 09:43:45 +03:00
Marius Vlad 3dc28308e6 libweston/color-management: Add fallback for static_assert
Attempt to fix the following with clang-18:

../weston-9999/libweston/color-management.c:890:2: error: call to
undeclared function 'static_assert'; ISO C99 and later do not support
implicit function declarations [-Wimplicit-function-declaration] 890 |
static_assert(UINT32_MAX <= SIZE_MAX, |         ^

Fixes: #948

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-29 16:20:47 +03:00
Marius Vlad 6bcf9ca6ba build: bump to version 13.0.93 for the RC1 release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-28 10:40:07 +03:00
Marius Vlad fe2ea233b1 libweston/drm-virtual: Point output base backend the DRM backend
This would allow output_repaint_timer_handler() to find a backend
as well for the DRM virtual outputs created by DRM virtual API and
with it to trigger a repaint for the outputs created by
plug-ins (remoting and pipewre).

Fixes 1f8c49d5bdd20, 'compositor: repaint backends separately'

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Michael Olbrich <m.olbrich@pengutronix.de>
2024-08-27 17:32:30 +03:00
Marius Vlad b4726ef024 libweston/drm-virtual: Add prepare_repaint to perform a repaint
With commit a1f8c49d5b, 'compositor: repaint backends
separately' a prepare repaint was introduced. Use it for DRM virtual API
to allow repainting the remoting/pipewire output.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-27 17:19:11 +03:00
Marius Vlad aa3fe6a27a build: bump to version 13.0.92 for the beta release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-21 12:01:02 +03:00
Derek Foreman 60d777803d drm: Remove unnecessary parameter from drm_output_state_alloc()
We never pass this anything but NULL.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-08-19 10:25:25 -05:00
Marius Vlad 49278973c0 build: bump to version 13.0.91 for the alpha release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-14 11:23:07 +03:00
Lukasz Czechowski 2fe23ad389 man: Update documentation of weston-vnc
Document the possibility to enable VNC backend with password-only
authentication.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
2024-08-14 07:48:09 +00:00
Lukasz Czechowski 3ecdd0486c vnc: Enable password authentication in non-TLS mode
If VNC is enabled without specifying server certificate and key,
TLS won't be activated. Use regular passsword authentication
instead.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
2024-08-14 07:48:09 +00:00
Lukasz Czechowski 58a0abcb58 vnc: Allow to disable Transport Layer Security
Some VNC clients, i.e. noVNC, do not support TLS encryption.
Add new argument "--disable-transport-layer-security" to
explicitly disable activation of TLS.
This will allow to extend VNC clients compatibility.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
2024-08-14 07:48:09 +00:00
Benjamin Herrenschmidt 89f3a8a71e Add support for FreeRDP 3.x
With this, Weston can build against either FreeRDP 3.x or 2.x depending
on what has been detected by meson (3.x takes priority).

The main source of changes is the settings are now opaque and require the
use of accessors. That was pretty mechanical and seems to work on 2.x as
well.

There are a few changes around constants getting a WINPR_ prefix, the UTF
conversion functions we used are obsolete, so use the proper "new" ones,
and other fairly minor things.

The key & cert management changed rather completely, libfreerdp won't load
files for us, we have to use the helpers to do so, and I *think* the RDP RSA
key and SSL key use the same setting location. Seems to work with SSL at
least.

There was also a minor glitch with keyboard input, KBD_FLAGS_DOWN is basically
never set. It appears to be an upstream FreeRDP change in 3.x, it was being
set incorrectly (always on any key down) while it should only be set on
repeats. However the fastpath input code has no way to set it from what I
can tell, so it's just loss. We instead ignore it.

Note that the screen size is odd (and different between freerdp client and
remmina), it also won't adjust dynamically when the window is resized. I
don't think this relates to my port though, I observe the same behaviour
with the packaged FreeRDP 2 based Weston, but I can try to look into it
later

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2024-08-14 12:29:28 +10:00
Marius Vlad e7ed5d201a weston.ini: Document the 'mirror-of' key
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-12 15:50:13 +00:00
Marius Vlad 75280d2e40 frontend: Disable client resize for RDP remote outputs
Similar to the VNC backend do the same for the RDP backed, as this would
allow to get a matching output, in dimensions, to the one we are
mirroring.

This also re-works a bit the no-clients-resize to be more inline with
VNC one.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-12 15:50:13 +00:00
Marius Vlad f43342cf78 frontend: Disable client resize for VNC remote outputs
As we're mirroring other outputs we shouldn't allow clients to resize
the output.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-12 15:50:13 +00:00
Marius Vlad 197c5e0084 frontend: Add support for tracking parent/mirror changes
If the DRM native output is changed propagate the changes
to the mirror as well.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-12 15:50:13 +00:00
Marius Vlad bd39f7edc1 frontend: Teach remote backends to use the scale from config
PipeWire/RDP/VNC were using by default scale 1, so allow
configuration using the ini config file.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-12 15:50:13 +00:00
Marius Vlad d553333da8 frontend: Share a native output using 'mirror-of' keyword
This would allow to screen-share a particular output like the
following:

[output]
name=vnc
same-as=DP-5

[output]
name=rdp-0
same-as=DP-4

[output]
name=pipewire
same-as=eDP-1

Both 'vnc', 'pipewire' 'rdp-0' remote outputs would then be a
screen-share 'DP-5', respectively, 'e-DP1', or the 'DP-4' DRM output.

Currently, this is intended only for VNC, RDP and PipeWire remote outputs.

This patch exports weston_output_set_position(), and uses that for
overlapping a remote output with a native DRM one, rather than using
weston_output_move() as that has a side-effect when reflowing outputs
from shells.

Further more creating this remote output is driven entirely by compositor
signal events such that enabling an DRM native output would enable the
remote output, while disabling the native would have the same outcome
for the remote one.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-12 15:50:13 +00:00
Marius Vlad c4eb15d453 libweston: Keep a local copy of native_mode
This avoids dereferencing a possible stale pointer, and allows
retrieving the modeline/refresh later on when one needs to retrieve
those values. This is a temporary band-aid.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-12 15:50:13 +00:00
Marius Vlad 3842c1c737 frontend: Expand simple head function
In order to allow passing additional pre/post callbacks. This allows
further re-use of the simple_head_enable() function instead of
creating a similar dedicated function. We can then re-use the same
function for enabling remote outputs.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-12 15:50:13 +00:00
Marius Vlad 14cfb97949 libweston: Add a helper for retrieving backend type
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-12 15:50:13 +00:00
Marius Vlad d88782bf41 frontend/man: Use 'clone-of' instead of 'same-as'
Rather than using the same key entry for the DRM backend to cloned
outputs, rename to 'clone-of'. This means that ini configuration files
will break after this change, but this should be documented with the
next Weston release.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-12 15:50:13 +00:00
Loïc Molinari bb6abf3c33 gl-renderer: Clean up comments
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2024-08-12 10:44:55 +00:00