shell_surface_update_layer() is the thing which moves our views around
into layers. Since we want to keep an invariant that a view is mapped if
it is on a layer, and unmapped if it is not on a layer, handle mapping
along with the layer moves.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Try to stick to a pattern of first mapping a surface, then inserting a
view into a layer together with marking it as mapped.
Signed-off-by: Daniel Stone <daniels@collabora.com>
weston_view_geometry_dirty() won't automatically clear out the old
region, so manually damage underneath the view before we mark the
geometry dirty.
Signed-off-by: Daniel Stone <daniels@collabora.com>
There is no way for shell_surface_calculate_layer_link() to give us a
NULL layer, so don't pretend it can and silently drop out without
removing it from the old layer.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Destroy the renderer before disconnecting the Wayland display.
Trying to destroy the GL renderer with the Wayland display already gone
crashes in the Mesa Wayland integration.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
After freeing the renderer, clear the compositor->renderer pointer to
avoid use-after-free errors.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Calling clip_transformed() 4 times in a row with the same polygon8 in
commit a4d31fa8bd introduced a bug
because the surf input is modified each time. This is fixed by working
on a local copy. The input parameter is marked constant to reflect the
change on the function prototype.
Fixes#764
Signed-off-by: Loïc Molinari <loic.molinari@gmail.com>
Now that we've concluded the Xwayland/fontconfig stuff, we don't
actually need a per-test wrapper; we can just set the options globally.
It turns out that we don't need to set the options at all anyway, since
the previous commit adds the LSan suppressions to all test runs, and
LSan is enabled by default, so we can just bin it.
Signed-off-by: Daniel Stone <daniels@collabora.com>
cf. the never-ending saga of how we can't neuter the fontconfig leaks,
also pass our CI leak-sanitizer suppression file when running tests
locally. This makes it easier to run with ASan enabled in your local
environment.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Fixes Meson warning:
../../git/weston/doc/sphinx/meson.build:40: WARNING: Project targets '>=
0.63.0' but uses feature deprecated since '0.56.0': meson.source_root.
use meson.project_source_root() or meson.global_source_root() instead.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
When I upgraded Sphinx to 5.3.0 from Debian bookworm, I got the error:
Warning, treated as error:
Invalid configuration value found: 'language = None'.
Update your configuration to a valid language code.
Falling back to 'en' (English).
This fixes it.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Prefer outputs that are not powered off when assigning a surface to an
output. If a surface covers the same area on two outputs, prefer the
one with the higher refresh rate.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
attach needs to consider the viewport as well, so it makes more sense
for attach to consistently access the weston_surface_state, rather than
part from the surface and part from a function argument.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Pull the buffer-size calculation in when we attach a new buffer. This
will be able to save us from doing the calculation at all in some cases.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Rebuilding regions can be an expensive operation, and we're adding more
of them. This means we need to be clever about when we actually do them.
Only dirty the paint nodes when the transform or buffer size has
actually changed, not on every commit.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Akin to the paint_node_status we already have, start also tracking a
surface dirty status. This will allow us to minimise the updates we need
to make.
Currently this is only collected, with no functional change made.
Signed-off-by: Daniel Stone <daniels@collabora.com>
On a desktop system, the expected behavior during a Weston start is that if any
monitor can be enabled, Weston starts up and enables the monitor. Outputs that
could not be enabled, stay disabled. This helps the user in debugging the failed
outputs.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
If Weston fails to configure a DRM output for whatever reason, it will fail to
start. Depending on the use-case, this may or may not be the correct behavior.
Add the "require-outputs" option to allow configuring the error behavior on
missing outputs.
Add documentation of the possible options to the man page.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
If there is an opaque full-screen view with a compatible SHM client
buffer left after peeling off the client-side cursor view, bypass the
renderer and let Neat VNC read from the client buffer directly.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Instead of directly converting damage from pixman_region32_t in
global coordinates to pixman_region16_t in local coordinates,
use weston_region_global_to_output() to convert to pixman_region32_t
in local coordinates and then convert again to pixman_region16_t
in the same coordinate system, using vnc_region32_to_region16().
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
We previously had our own local variable for this, but now we can just
use the one in weston_compositor.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Currently Xwayland is cleaned up by a destroy listener. The problem with
this is that this is true for both libweston's Xwayland support as well
as the frontend's.
Add an explicit destroy step to Xwayland frontend which will cleanly
destroy the process as well as any other resources.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Return a void * from wet_load_xwayland, so we can later pass it back to
explicitly call the cleanup.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Make sure that we consistently mark the client as NULL when it's
destroyed, and destroy it on process exit as well, so we have a
consistent state.
Signed-off-by: Daniel Stone <daniels@collabora.com>
We rely on the Xwayland launcher setting $DISPLAY to connect to our own
X server. Make very sure in the tests that we're actually getting that
set properly.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Remove all handling of process/PID internals from libweston's Xwayland
launcher, and keep this only in the frontend. libweston now only sees
the wl_client and nothing else.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Every time we call wet_client_launch, we now allocate a new wet_process,
which is always cleaned up by the compositor core and not by the users.
In doing this, weston_client_launch is renamed to wet_client_launch,
since wet_ is for the frontend and weston_ is for libweston.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Instead of reusing an inline wet_process struct, allocate a new
wet_process every time we go to launch Xwayland.
Signed-off-by: Daniel Stone <daniels@collabora.com>
wet_process provides a cleanup function which can be called, but only
passes the process itself. This relies on the process struct being
inlined in something else meaningful, and means that we can't allocate
them on demand.
Add a 'data' argument which allows users to pass meaningful data to
their cleanup handler.
Signed-off-by: Daniel Stone <daniels@collabora.com>