Reorder the sections into what people care about: what is it, how do I
build it, how do I run it, where are the docs for when I want to do
more?
The libweston section has been substantially rewritten to trim the
details down to what is accurate and relevant, and the introduction has
accordingly been updated to reflect the reality of Weston as a project
today.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Not only are Sphinx and Breathe clearly not placeholders by this point,
but no-one really cares about the development history, just what it
means to them, i.e. how to use it.
Signed-off-by: Daniel Stone <daniels@collabora.com>
To the extent that it's accurate, it's already obvious. Packagers have
figured out how to package it anyway.
Signed-off-by: Daniel Stone <daniels@collabora.com>
No need to itemise every environment around; it's common enough these
days that people can work it out.
Signed-off-by: Daniel Stone <daniels@collabora.com>
We were storing the output description into the name field, which was
harmless but did cause a leak.
Signed-off-by: Daniel Stone <daniels@collabora.com>
When the pointer is confined and we are handling motion, we need
up-to-date view transforms in order to respect the confinement. So
update view transforms in such case.
This fixes an issue in which we'd try to transform views with dirty
transforms in weston_pointer_clamp_event_to_region(), hitting an assert.
This is a leftover of d611ab24 "libweston: Update view transforms more
often".
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
When the output is moved, move its per-framebuffer accumulated damage
with it. The alternative would be to track accumulated damage in the
local output coordinate system, but that would require translating back
into global coordinates for repaint_output.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Use parse_simple_mode() to allow configuring the VNC framebuffer size
with a mode property in weston.ini, like this:
[output]
name=vnc
mode=1280x720
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
To make it reusable, extract parse_simple_mode() from
wet_configure_windowed_output_from_config().
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Currently linux-dmabuf.h implicitly depends on libweston.h being
included before it. Instead of adding missing includes for bool,
dev_t, struct timespec, struct weston_compositor,
struct weston_drm_format_array, struct wl_array, and struct wl_list,
just include libweston.h.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
The main surface commit includes the xdg surface commit. Here, the
accumulated surface size is validated. All subsurfaces must be comitted
first to ensure that the corrent current values are used.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Use the gl-renderer border code shared with headless-backend. We can
drop all this open-coded stuff.
In the output disable path, make sure to call this only when gl-renderer
is used. It will also reset the border state in gl-renderer, which is
harmless here, and it's necessary in the resize path.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Move this code from headless-backend to a helper library, so it can be
shared with wayland-backend.
gl-renderer.h was missing #pragma once, which made the build fail.
Unfortunately gl-borders needs gl-renderer.h which will attempt to
include EGL headers if gl-renderer is enabled in the build, so we must
get the EGL build flags too, just for the headers.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Refactor this code into two backend-agnostic functions, that in the next
step can be moved into code shared between backends.
Pure refactoring, no changes.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
GL-renderer keeps the pointer for the border image data for later use.
When we destroy our cairo_surface, that data gets freed. Therefore,
reset the pointer stored by GL-renderer too, to ensure use-after-free
cannot happen.
This is not really necessary in this particular case, because the
renderer output is destroyed immediately after, so there is no chance of
UAF.
However, this is needed for code sharing purposes. Wayland-backend will
do exactly this when an output is resized. To share this code with
wayland-backend, we also need to reset the pointers. It's harmless and
more correct in the output disable path.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Replace a bunch of copied code with a loop over a simple array. This
makes the code easier to read, and allows further refactoring.
This is pure refactoring, no changes to results or behavior.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Make sure dep_egl is always a valid dependency object, even if not
found. Ensure it is not found when not wanted, to avoid linking when
found but not wanted.
Using a not-found dependency in Meson is defined to be a safe no-op, so
use that to simplify the backend dependencies.
libweston/meson.build already errors out if renderer-gl is enabled and
EGL is not found, so the same checks can be removed from the backends.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Now that struct weston_head contains a pointer to the backend owning
the head, choose to call the same backend's create_output callback.
This will be necessary to support loading multiple backends
simultaneously.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Compositor code can use opaque pointer comparison to determine whether
a head belongs to a given backend. Store a backend pointer in struct
weston_head to enable the compositor to select the correct backend
specific output configuration code.
This also allows to use the backend pointer instead of the opaque
backend_id pointer to check whether a head belongs to a backend, so
replace the checks in all to_xyz_head() functions and drop backend_id.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
No output is created at this point. Even if an output existed,
it should be relased when the head ist destroyed.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
vnc_ensure_matching_mode() does not transfer flags from init_mode.
Set flags on the returned mode instead.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Let xzalloc warn and abort when running out of memory.
With this, vnc_insert_new_mode() and vnc_ensure_matching_mode() can not
return NULL anymore. Remove the now unnecessary error handling.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Let xzalloc warn and abort when running out of memory.
With this, vnc_head_create() doesn't need an error return value anymore.
Remove the now unnecessary error handling.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Let xzalloc warn and abort when running out of memory and remove the
now unnecessary error handling.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
struct weston_renderer is defined in libweston-internal.h, which is not
included from libweston.h. Add the missing forward declaration for the
renderer pointer stored in struct weston_compositor.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
While the --backend parameter looks like it takes a file name, it really
is selected from a list of supported strings that are then funneled
through a translation to enum weston_compositor_backend [1].
Because all backend parameters are of the form "...-backend.so", and
writing "--backend=...-backend.so" is boring, allow the --backend option
to match the backend name without "-backend.so" suffix instead.
For example, this allows to use "--backend=headless" instead of
"--backend=headless-backend.so".
Update help text and documentation. Keep the old way working for
backwards compatibility.
[1] 50dbf38514 ("libweston: use enum to choose the backend")
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Now that the renderer type is stored in struct weston_renderer,
use that instead of use_pixman to determine the renderer type.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Now that the renderer type is stored in struct weston_renderer,
use that instead of use_pixman to determine the renderer type.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Now that the renderer type is stored in struct weston_renderer,
use that instead of use_pixman to determine the renderer type.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Move the renderer type from struct headless_backend into struct
weston_renderer to store the chosen renderer type in a unified manner.
This will later allow secondary backends to determine the renderer type
chosen by the primary backend.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Various shells provide the functionality to take screenshots using the
weston-screenshooter or a key combination. This is useful on the ivi-shell, too.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
The output capture protocol is also provided by the kiosk shell and the
fullscreen shell. Therefore, the weston-screenshooter to take screenshots should
be built if the desktop shell is disabled, too.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Now that we don't accidentally delay our selection ownership changes,
let's assert() if we somehow find ourselves downloading our own selection,
as the assertion is simpler to understand than the mess that ensues if
we hit this.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
If we don't xcb_flush() when we set the selection owner, we end up with
a ridiculous corner case where we can run use a command line X client
like 'xclip -i -selection clipboard' to crash weston.
Start weston, ensure Xwayland is running (set a selection with xclip), set
the clipboard from a wayland client, then set the clipboard with xclip
again.
Since xclip doesn't do anything xwm notices except set the clipboard, it
won't provoke a flush on our selection ownership change. xclip will take
ownership, then we call xcb_convert_selection(), and THEN we flush, sending
out our pending ownership change and the xcb_convert_selection() request.
The ownership change takes place first, we attempt to get our own selection
and weston explodes in a mess.
Stop this from happening with a flush when changing selection ownership.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
It's possible to set the clipboard with no seat present - one way is to
use the RDP backend and then run 'xclip -i -selection clipboard' locally
without making an RDP connection.
Check if seat is NULL to prevent this from crashing.
Fixes#698
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
It's possible that there are no seats present at startup (especially with
the RDP backend, which creates and removes seats for connections), and
previously we'd just fail to set up XWayland cut and paste properly.
We should set up a listener and find a seat when one becomes available -
but we also need to switch seats if ours is removed.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Co-authored-by: Hideyuki Nagase <hideyukn@microsoft.com>
When the pointer is constrained and the surface in which it is
constrained gets committed, we may warp the pointer in some
circumstances. In order to do that, we need the associated view
transforms up-to-date. So update view transforms when this surface gets
committed.
This fixes an issue in which we'd hit an assert when trying to warp the
pointer, as we were trying to transform views with dirty transforms.
This is a leftover of d611ab24fd
"libweston: Update view transforms more often".
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This should prevent extra focus signal emission the similarly to
how default_grab_pointer_focus() does, though we don't have the
surface jumping logic here.
This stops xdg pings from being sent every output repaint during
a grab when the pointer isn't in any windows belonging to the
grab parent.
An example would be running weston-terminal, bringing up the
right click pop-up, and moving the mouse onto the desktop while
another client causes repaints.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This prevents a spurious pointer focus clear at the start of a grab.
This would, for example, cause an extra pointer leave when bringing
up a right-click pop-up in a ttk app like weston-terminal.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Here are more tests for output decorations drawing, this time through
the color-lcms plugin. This is the only practical way to exercise the
input-to-output category of color transformations.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>