Directly destroying the cprof is not ideal, because it may hide issues
that we have in the code. If we are destroying a cprof with ref_count
bigger than 1, there's something wrong that we need to fix.
Instead, assert that the stock sRGB cprof has ref_count == 1 when we are
destroying the color manager. And use unref() instead of destroy().
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Ignore any client-supplied offset to subsurface commits to keep the same
consistency we find on other compositor.
Fix: #829
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
If an X window has not been resized yet, and the user clicks (not drags)
on a part of the window frame that can be used to resize, the window
will resize to 512, 512.
This is likely because of the changes in ba82af938 and 2acd2c748
that change resize behaviour but missed updating saved size when the
client's initial configure occurs.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Otherwise we end up with an invalid backend on the shutdown path of the
compositor. This mimics what the wayland back-end does.
Fixes 14c52a942b, 'backend-x11: enable multi-backend support'.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Since hmi-controller adds surfaces to layers when creating ivi surfaces,
the launcher will appear on startup. As before, the launcher surface is
created before the background surface so that the background will appear
on startup.
Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
Activate when a surface is created and change focus when an active
surface is removed. The Surface is added to layers when it is created,
because it must be added to a layer to be active.
Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
The keyboard focus is active, but the desktop surface itself is not
displayed as active. Therefore, the surface should also be displayed as
active, as in kiosk-shell.
Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
Add to handle seet hotplugging so that seats are properly picked up by
ivi-shell when they are dynamically created.
Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
Conditionally create the renderer like other secondary backends.
Now that we have multi-backend support and overlapping outputs, an
interesting use case for the headless backend exists.
We can have a high performance steady state on the drm backend with
all content on scan-out planes, bypassing the renderer. Taking a
screenshot of this would ideally use readback, but some hardware is
incapable of readback, or only capable at certain resolutions.
By using the headless backend as a secondary backend, and creating a
headless output that overlaps the drm outputs, we can take the
screenshot on the headless backend without disrupting the plane
layout on the drm backend.
For this to be efficient, other changes need to be made, but this is
a step in that direction.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
A constraint always has a surface, but may not have a view - use the
surface pointer directly without trying to get it through the view.
Fixes#823
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Similar to what we have to all other backends/outputs, do the same
for the remoting/pipewire plug-ins and align them to the right.
This way we can move the plug-ins loading after
weston_compositor_flush_heads_changed(), much closer to the other module
loading which seems a more suitable place.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Rather than loading the plug-ins when loading the DRM backend, do that
after *all* the other backends have been loaded, and after we made sure
we have at least a no-op color manager.
As the plug-ins enable the outputs on their own this has the side-effect
of enabling the output without having any color manager set-up at that
time. Moving the plug-in loading a bit later ensures that we have one
set-up (a no-op one).
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Further follow-up from 8895b15f3d 'ci, backend-vnc: update to Neat
VNC 0.7.0', to allow building with the subproject wrap as well.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Any coordinate that didn't change during clamping was left uninitialized,
resulting in failures later.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Between assign_planes() and pnode_update_late(), the pnode's plane may
not yet be up to date. This leads to the visible region being incorrectly
calculated for paint nodes beneath a paint node that changes planes. Their
visible regions will still contain a cut out for the node that no longer
occludes them.
However, we place damage on nodes beneath a node that changes planes in
order to redraw the region beneath a node that moves from the primary to
non-primary plane.
The gl-renderer clips to a paint node's visible region when rendering it,
so this accidental cut-out masks away all the damage and leaves us with
a mess.
Fix this by using the correct plane in the visibility calculation.
Fixes#821
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
If coverage and power status are the same, we should prefer a primary
backend over a secondary one.
Fixes#818
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
When an output power state changes, it may become or no longer be the
best primary output for a view.
Fixes#819
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
If our primary output is turned off, we won't get frame events, so let's
try really hard to prioritize a turned on output with coverage.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
In some use cases the VNC client should not be allowed to resize the VNC
output. Add a boolean option "resizeable" in the VNC [output] section to
control this.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Separate the concept of a surface being mapped (where it has current
content) from views being mapped (visible on a layer).
Signed-off-by: Daniel Stone <daniels@collabora.com>
Rather than checking if the surface has width 0, use our helper to see
if the surface has an attached buffer.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Don't look it up from the view every time, but instead just work
completely from global co-ordinates.
Signed-off-by: Daniel Stone <daniels@collabora.com>
We need to know which output we're on, and the surface type plus output
uniquely identifies us, so just pass that in.
Signed-off-by: Daniel Stone <daniels@collabora.com>
We only have one of those per output, and we need to dig them out later,
so just store a direct pointer to them.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Make background and panel surfaces do the right thing: map the surface
when it first gets content applied to it, and only move the view around
when required.
Signed-off-by: Daniel Stone <daniels@collabora.com>
We only want one background and/or panel per output. If another one
comes up, tell the client it's done something very bad, rather than
trying to gently negotiate our way out of the situation.
Signed-off-by: Daniel Stone <daniels@collabora.com>
If our background and/or panel surface already has a view, something
extraordinarily weird has gone on. Don't try to deal with it.
Signed-off-by: Daniel Stone <daniels@collabora.com>
A view is mapped if it's on a layer, so if we find it in a layer then we
don't need to worry about whether or not it's mapped.
Signed-off-by: Daniel Stone <daniels@collabora.com>
The counterpart to weston_surface_is_unmapping(). This is valid for the
duration of processing the surface commit.
Signed-off-by: Daniel Stone <daniels@collabora.com>
If a surface has already been mapped, just return early out of
weston_surface_map(), rather than firing the map signal and rebuilding
the view list.
Signed-off-by: Daniel Stone <daniels@collabora.com>
We already have these for global coordinates, now we have them for
surface coordinates too. In addition to removing some unsightly
unadorned coordinate usage, this also adds appropriate coordinate space
id checks at runtime.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This is a tricky bit of code and we use it in two places. Let's make a
single implementation.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Document the --additional-devices parameter to Weston to add secondary
DRM devices that will only be used as outputs, but not for rendering.
Fixes: 3c6cfe6bf4 ("backend-drm: add additional-devices to support multi GPU")
Signed-off-by: Marek Vasut <marex@denx.de>
Second try at removing direct logind support. This time more careful
with the documentation, as libseat can still use logind even if we don't
directly use it.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>