Previously, commands could only be specified by their path,
so it was not possible to pass arguments.
Use the 'command' config first,
and if it is NULL, fall back to the existing 'path' config.
Signed-off-by: Gyeyoung Baek <gyeyoung976@gmail.com>
Co-authored-by: Michael Olbrich <m.olbrich@pengutronix.de>
A client can call get_xdg_output() at any time. If the output was destroyed,
then all output resources are orphaned. This includes clearing the user data of
the resource.
This can happen, for example, when a monitor or HDMI switch quickly toggles the
HDMI hotplug pin.
So check if a head is associated with the resource. If not, just create the
resource and then return immediately.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Doing these in the wrong order breaks content protection, and breaks
placing direct-display paint nodes on underlays.
Fixes: 827e2276 ("gl-renderer: Draw holes on primary plane for the view on underlay")
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We need to reset the underlay check inside the view evaluation loop,
otherwise once we need an underlay we'll treat every following view as
needing an underlay.
Fixes: 1065d23406 ("backend-drm: Improve plane assignment for underlay platform")
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
The dmabuf allocator pulls in libgbm which lives inside Mesa and is built
as a non-standalone part Mesa. This makes gl-renderer hard-wired to Mesa.
The allocator is only used by an optional pipewire backend so make
the allocator optional too.
Signed-off-by: Tomek Bury <tomek.bury@gmail.com>
The buffer_init function added with commit 83b37c0ac4, "renderers: pull
dmabuf initial setup out of attach", doesn't take into consideration the
the buffer's direct-display property.
Previously, gl_renderer_attach_dmabuf, wasn't being called when dmabuf's
direct-display was turned on, but with commit 83b37c0ac4 this has been changed.
So with commit 83b37c0ac4, linux_dmabuf_buffer_get_user_data will never
return a valid gb (gl buffer state), causing a crash using
direct-display extension. This adds an explicit check to return early
when this happens.
Fixes: 83b37c0ac4, "renderers: pull dmabuf initial setup out of attach"
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
As weston_windowed_output_get_api needs ARRAY_LENGTH() move helpers to a
libweston/ so other users can re-use that instead of re-defining these
all over. Easier for other front-ends to make use of them.
With this change windowed-output-api.h also includes the helpers header.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Fix binding-modifier "none" which was defaulting to Super.
Commit [1] introduced the original support for "none" but the logic was
subsequently lost in f7ba35f5.
[1] 553d1248 ("desktop-shell: Allow binding-modifier weston.ini option to be none")
Fixes: #976
Fixes: f7ba35f5 ("kiosk-shell: Enable debug keybindings")
Signed-off-by: Ian Ray <ian.ray@gehealthcare.com>
We can startup with the display already in type1 content protection mode.
When this happens, we call weston_output_dirty_paint_nodes() on a display
that hasn't yet been enabled. The paint node list isn't initialized yet,
so we crash.
We don't actually need to touch the paint nodes here anyway, as
weston_output_damage() ensures a repaint if the ourput is enabled, and
weston_output_dirty_paint_nodes() just forces calculation of things
unrelated to protection, and we'll override most of that in
maybe_replace_paint_node() if necessary when we get there.
Just drop the weston_output_dirty_paint_nodes() call to stop the
crash.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Which is used on the RPi4/5 by the HEVC HW decoder for 10bit content.
Note that this is not enough to make KMS offloading work as the
decoder uses the BROADCOM_SAND128 modifier which - for now - requires
manual/unusual handling (i.e. this requires going through GL).
Signed-off-by: Robert Mader <robert.mader@collabora.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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 c4eb15d453Fixes#949
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
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>
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>
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>