Commit graph

9068 commits

Author SHA1 Message Date
Daniel Stone 570bf1824a desktop-shell: Don't restart client on exit
When we're shutting down, don't try to restart the shell client.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone 9aa68248a9 backend-drm: Use weston_compositor.shutting_down
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>
2023-06-19 21:32:47 +01:00
Daniel Stone 579019a78d libweston: Add weston_compositor.shutting_down
It does what it says on the box: is true when the compositor is in the
process of shutting down.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone 52987b0354 frontend: Clean up wet_processes on exit
When we exit, clean up any process we launched.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone 388702c181 frontend: Explicitly destroy Xwayland from frontend code
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>
2023-06-19 21:32:47 +01:00
Daniel Stone 10f6b99ac0 frontend: Return user-data pointer from Xwayland init
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>
2023-06-19 21:32:47 +01:00
Daniel Stone eff5e7e0f3 xwayland: Add client destroy listener
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>
2023-06-19 21:32:47 +01:00
Daniel Stone 506901d918 xwayland: Rename destroy_listener to be more explicit
compositor_destroy_listener tells us exactly what it is.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone 104676ec1f xwayland: Remove process exit status from libweston API
This shouldn't be relevant to the core.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone f360818960 tests/xwayland: Ensure $DISPLAY is correctly set
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>
2023-06-19 21:32:47 +01:00
Daniel Stone e64232a808 xwayland: Only pass Xwayland wl_client to libweston
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>
2023-06-19 21:32:47 +01:00
Daniel Stone d5bcc26078 frontend: Factor out wet_process_destroy
Reuse the body of the process cleanup as a separate function.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone 991b3fb2e0 frontend: Inline process_handle_sigchld
Now that we have wet_process everywhere, print out the process exit
status in the main handler.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone 9a7c88c2e9 frontend: Make wet_client_launch allocate new wet_process
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>
2023-06-19 21:32:47 +01:00
Daniel Stone 31dcd987a6 frontend: Allocate new wet_process for Xwayland
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>
2023-06-19 21:32:47 +01:00
Daniel Stone a72d0c1bb0 frontend: Allow NULL wet_process cleanup handler
Don't call cleanup if we haven't been given anything to call.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone c2cd15ed11 frontend: Add data argument to wet_process cleanup
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>
2023-06-19 21:32:47 +01:00
Daniel Stone abe893d8ea frontend: Rename weston_client_start to wet_client_start
It's not libweston, so it shouldn't be weston_.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone 348465cd7a frontend: Inline wet_watch_process
Now we only have one place we launch processes, we can just inline this
wl_list_insert.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone 4326d3c768 frontend: Rename weston_process to wet_process
It's not a libweston thing, it's a part of the frontend.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone d8114aa888 frontend: Remove process_info
This is just an empty shell around weston_process.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone ca55f0549b frontend: Move path into weston_process
We have this everywhere, so we can move it out of process_info.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone 2a9f7aabdb CI: Require wayland 1.22 for wl_client_add_destroy_late_listener
We need this in coming patches.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:46 +01:00
Daniel Stone e35977f3a0 CI: Add Debian bookworm jobs
Bookworm has just been released. Add jobs which start using it, but keep
bullseye around as the LTS release, to make sure we can build on new and
old distributions.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 20:09:03 +00:00
Daniel Stone 0e4aa29e4b CI: Upgrade Mesa and kernel
Debian bookworm needs a newer version of Mesa to build against LLVM 15.
Upgrade Mesa and the kernel whilst we're at it, just to make sure that
things keep working.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 20:09:03 +00:00
Daniel Stone 64ae26702d CI: Bump virtme snapshot version
Apparently qemu upstream has deprecated -watchdog and just uses the more
generic -device now.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 20:09:03 +00:00
Daniel Stone c2d5199937 CI: Force pip to install packages
Newer versions of Debian make you pass --break-system-packages to pip in
order for it to install packages. Since we do want to keep using pip for
controlled versions rather than the distribution packages, add this
flag.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 20:09:03 +00:00
Daniel Stone c7f09dbbac CI: Rename debian jobs to debian-lts
Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 20:09:03 +00:00
Daniel Stone ef55d79727 CI: Parameterise LLVM version
Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 20:09:03 +00:00
Daniel Stone 5ccb33ac02 CI: Upgrade ci-templates version
This is required to support Debian bookworm.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 20:09:03 +00:00
Derek Foreman db51409b9a desktop-shell: Pass a weston_coord to calc_input_panel_position
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-06-19 13:09:03 +00:00
Derek Foreman aea5ca97ae kiosk-shell: Use weston_coord for grabs
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-06-19 13:09:03 +00:00
Derek Foreman 643c9b929f desktop-shell: use weston_coord in weston_move_*_grab
Replace some wl_fixed_t pairs with weston_coord.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-06-19 13:09:03 +00:00
Derek Foreman 2ac566d281 libweston: Add more weston_coord arithmetic helpers
Until now we've only had the unadorned arithmetic functions, but they're
easy to abuse and tedious to use.

For now, we just add weston_coord_global_add/sub functions and use them
where appropriate.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-06-19 13:09:03 +00:00
Derek Foreman d961e59d4a libweston: Add getters for view position/offset
This is stored as an unadorned weston_coord internally, but with getter
functions we can put together the appropriate global or surface
coordinate.

Use them where appropriate.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-06-19 13:09:03 +00:00
Derek Foreman 1f81c082b5 libweston: Add weston_coord_truncate()
Truncating a weston coord to integer values is something we do
frequently enough to warrant a helper function.

Use this in the kiosk and desktop shells where appropriate.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-06-19 13:09:03 +00:00
Philipp Zabel ca1f6936c4 backend-rdp: GL renderer support
Let the GL renderer render to FBOs for RDP outputs and read the pixels
into the RDP frame buffer. This allows to run the RDP backend with the
GL renderer.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-06-15 15:48:26 +00:00
Philipp Zabel dbe5b53766 backend-rdp: add pixel format info array
Store pixel formats on the backend and stop open coding Pixman format
codes.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-06-15 15:48:26 +00:00
Philipp Zabel 17d7353b36 backend-rdp: move code to prepare for GL renderer support
Add switch statements where renderer specific API is called to prepare
for adding GL renderer support. No functional change.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-06-15 15:48:26 +00:00
Philipp Zabel e0c7fd1586 backend-rdp: bring back shadow_surface image
Partially revert commit 89e1831cd7 ("pixman-renderer: add
weston_renderbuffer and create/destroy interface") to bring back the
shadow_surface pixman image. The renderbuffer is only wrapped around it.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-06-15 15:48:26 +00:00
Sergio Gómez 03aeb4bd83 clients: Replace 'confine' client to showcase pointer constraints in general
The 'confine' client is used to showcase the behavior of pointer confinement
through the interface zwp_confined_pointer_v1.

Since zwp_confined_pointer_v1 is part of pointer constraints in general, which
includes pointer locking, it makes sense to augment the scope of the client so
it can serve as a showcase for this category of interfaces through
zwp_pointer_constraints_v1.

Currently 'confine' relies on, and is designed around the limitations of, the
toytoolkit. Adapting the toytoolkit for the new requirements proved
unproductive, especially since we wish to add support for pointer constraints in
sub-surfaces. Hence the solution adopted was to write a new client that would
replace the previous one.

This patch introduces the new client, 'constraints.c', replacing 'confine.c'.

Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
2023-06-14 16:26:34 -05:00
Sergio Gómez 65740ca9a7 tests: Add basic testing for pointer constraints protocol
Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
2023-06-14 10:27:14 +03:00
Sergio Gómez 34269c4708 tests: Add a button binding to weston-test-desktop-shell
We need this so that Weston can update the "click to activate" serial, so
that we can then use the constraints protocol (see
maybe_enable_pointer_constraint() in libweston/input.c).

Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
2023-06-14 10:27:14 +03:00
Philipp Zabel efc846b659 gl-renderer: fix FBO renderbuffer download extents
Translate damage extents used to calculate glReadPixels rectangle from
global to local coordinates.

Fixes: b1606a9f2c ("gl-renderer: support automatically downloading FBO renderbuffers")
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2023-06-13 22:48:22 +00:00
Philipp Zabel 6083a613e6 libweston: damage moved outputs
When an output is moved, all views that are not moving with it should
cause damage where they appear in it before and after the move, and all
prior damage should move with the output.
To avoid this complexity, just damage the full output after the move.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-06-13 22:38:30 +00:00
Marius Vlad 51f377b813 desktop-shell: Do another update transform
This is similar to commit 'libweston: Update view transforms more often', where
we update the view's transform when getting the panel dimensions.

Fixes #740

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-06-13 16:32:39 +00:00
Philipp Zabel 291958682f backend-wayland: track damage on renderbuffers
Track damage on struct weston_renderbuffer and drop the custom damage
region from struct wayland_shm_buffer.

Pass repaint damage to wl_surface_damage() instead of accumulated
renderbuffer damage.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2023-06-13 15:43:56 +00:00
Philipp Zabel 5b1974fa4f backend-pipewire: add GL renderer support
While the GL renderer is not able to directly render into the PipeWire buffers,
it is possible to read the rendered frame from the fbo into the PipeWire buffer.

Use the automatic download to add support for the GL renderer to the PipeWire
backend.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
2023-06-13 13:02:12 +00:00
Michael Tretter a9d1b5dc50 backend-pipewire: make renderer initialization depend on renderer
Instead of always initializing the Pixman renderer, make the initialization
dependent on the selected renderer. This makes it easier to add other renderers.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
2023-06-13 13:02:12 +00:00
Michael Tretter 1effba000e backend-pipewire: add local variables for spa_buffer and data
Make it easier to understand where ptr points to by using local variables for
the spa_buffer and spa_data.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
2023-06-13 13:02:12 +00:00