src/agl-compositor.git
30 hours agocompositor: Use stdint for specifing integer storage master next
Marius Vlad [Fri, 26 Apr 2024 11:04:08 +0000 (14:04 +0300)]
compositor: Use stdint for specifing integer storage

Fixes the following build failure on arm32:

| ../git/src/compositor.c: In function 'log_timestamp':
| ../git/src/compositor.c:1848:39: error: format '%li' expects argument of type 'long int', but argument 6 has type '__suseconds64_t' {aka 'long long i
nt'} [-Werror=format=]
|  1848 |         snprintf(buf, len, "%s[%s.%03li]", datestr,
|       |                                   ~~~~^
|       |                                       |
|       |                                       long int
|       |                                   %03lli
|  1849 |                         timestr, (tv.tv_usec / 1000));
|       |                                  ~~~~~~~~~~~~~~~~~~~
|       |                                              |
|       |                                              __suseconds64_t {aka long long int}

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I9c9a532e2535501035867ed29a2d296900509489

7 days agoclients/screenshot: Add support for weston output capture
Marius Vlad [Thu, 18 Apr 2024 15:34:47 +0000 (18:34 +0300)]
clients/screenshot: Add support for weston output capture

libweston now provides a protocol which we can use for doing
screenshots, not needing to provide one ourselves. This imports
a simple client used in Weston but it has some changes to match
our current args.

Bug-AGL: SPEC-5095
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I00c9e976975447c74668fbfe1045b9177c623064

7 days agocompositor: Fix wet_process cleanup on compositor shuwdown
Marius Vlad [Thu, 18 Apr 2024 12:02:56 +0000 (15:02 +0300)]
compositor: Fix wet_process cleanup on compositor shuwdown

Bug-AGL: PEC-5104
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ib57d93378847cf2c7fa07782d983a179fa4a7ce8

9 days agocompositor: fix building with RDP disabled
Scott Murray [Wed, 17 Apr 2024 18:31:09 +0000 (14:31 -0400)]
compositor: fix building with RDP disabled

Fix declaration of stub function used when the RDP backend is
not enabled.

Bug-AGL: SPEC-5096, SPEC-5061

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
2 weeks agocompositor: Add support for building Xwayland
Marius Vlad [Mon, 8 Apr 2024 12:37:42 +0000 (15:37 +0300)]
compositor: Add support for building Xwayland

This updates with the Weston's front-end.

Bug-AGL: SPEC-5096, SPEC-5061
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Id421bdd04fc6943e991cbf51e9478450411721ef

2 weeks agocompositor: Fix RDP loading code
Marius Vlad [Thu, 4 Apr 2024 14:07:07 +0000 (17:07 +0300)]
compositor: Fix RDP loading code

Some minor changes were added to the RDP backend, so these just updates
our loading code to it.

Bug-AGL: SPEC-5096, SPEC-5061
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I411c825c098a4201a0d017856da3d979f5d9f6ff

4 weeks agocompositor: Fix loading nested X11/Wayland backends 98/29798/1
Marius Vlad [Thu, 28 Mar 2024 11:55:06 +0000 (13:55 +0200)]
compositor: Fix loading nested X11/Wayland backends

The AGL compositor frontend uses ivi_output to denote an output and pass
it around, with the implication that's available on retrieval later on.
In order for that to actually work, and by the mechanism we are
retriving it we need to install a destruction handler a bit earlier,
such that is available.

Bug-AGL: SPEC-5096, SPEC-5061
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ifbbfff67c75f98fe4ce84613674fb308880bf7e6

4 weeks agocompositor: Add more error messages 97/29797/1
Marius Vlad [Thu, 28 Mar 2024 11:06:06 +0000 (13:06 +0200)]
compositor: Add more error messages

This prints out eariler when a backend failed to load.

Bug-AGL: SPEC-5096, SPEC-5061
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I0414d65199177c70c9d98fd6920f70e18b415f4b

4 weeks agolayout: Fix panel initialization with no weston surface 96/29796/1
Marius Vlad [Thu, 28 Mar 2024 09:46:19 +0000 (11:46 +0200)]
layout: Fix panel initialization with no weston surface

Bug-AGL: SPEC-5096, SPEC-5061
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ib60ad86aa893d812ce4cf2babbb28b860c9b94a4

4 weeks agocompositor: Re-work the DRM and other backends loading phase 95/29795/1
Marius Vlad [Wed, 27 Mar 2024 16:26:11 +0000 (18:26 +0200)]
compositor: Re-work the DRM and other backends loading phase

This follows Weston frontend code for loading up and head/output
enablement. RDP, Wayland and X11 backend loading are all handled
through the same common code, while the DRM one has a clear distinct
one. This greatly simplifies the loading phase and provides a more
easier, intuitive code review.

Bug-AGL: SPEC-5096, SPEC-5061
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I97d39004dea0e030478f27ea18989887b8e2cc82

4 weeks agolayout: Migrate the layout save/restore to a more useful place 94/29794/1
Marius Vlad [Tue, 26 Mar 2024 12:52:31 +0000 (14:52 +0200)]
layout: Migrate the layout save/restore to a more useful place

Bug-AGL: SPEC-5096, SPEC-5061
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I5d7284de09485a42dd84075b5fa2268a81982745

4 weeks agocompositor/build: Remove HEADLESS backend 93/29793/1
Marius Vlad [Tue, 26 Mar 2024 09:03:03 +0000 (11:03 +0200)]
compositor/build: Remove HEADLESS backend

Headless backend was introduced to test out the compositor but never
materialized. Besides removing headless loading of the backend, also
do a bit of clean-up and remove vnc and pipewire strings as we currently
have no such backend capability at this moment.

Bug-AGL: SPEC-5096, SPEC-5061
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I87fdc0aa6c41bdcc8b1f53880860df7139ca7ae8

4 weeks agocompositor: Don't reuse weston_compositor_create_output 92/29792/1
Marius Vlad [Mon, 25 Mar 2024 14:46:52 +0000 (16:46 +0200)]
compositor: Don't reuse weston_compositor_create_output

With libweston 13 we don't have a create with head option. Just use the
one available has underneath that's what is using as well.

Bug-AGL: SPEC-5096, SPEC-5061
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I236d9caa193dafdd20dc2636a517c4e5bf597bd7

4 weeks agolayout, shell: Use implicit layer move to add views to layers 91/29791/1
Marius Vlad [Thu, 21 Mar 2024 10:14:08 +0000 (12:14 +0200)]
layout, shell: Use implicit layer move to add views to layers

This afffects the background/panels and black curtain installment,
with regular activation still using the older approach.

Bug-AGL: SPEC-5096, SPEC-5061
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: If8f8272fa29e02535eb5751a3119eb6deba0c3ae

5 weeks agocompositor: Fix RDP and HEADLESS backends loading
Marius Vlad [Wed, 20 Mar 2024 13:39:24 +0000 (15:39 +0200)]
compositor: Fix RDP and HEADLESS backends loading

Bug-AGL: SPEC-5096, SPEC-5061
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Id2a3001e02f1be62c621f942be69e5006c20e7a3

5 weeks agocompositor: Adapt loading to latest version
Marius Vlad [Mon, 11 Mar 2024 18:24:30 +0000 (20:24 +0200)]
compositor: Adapt loading to latest version

Some missing bits to adapt to loading correctly the backends.

Bug-AGL: SPEC-5096, SPEC-5061
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ibc97d9701ca6dfd7326362fcd2dcf3af681ad704

6 weeks agosrc: weston_process renamed to wet_process
Denys Dmytriyenko [Wed, 31 Jan 2024 00:04:17 +0000 (19:04 -0500)]
src: weston_process renamed to wet_process

Also, wet_process.cleanup now takes extra data argument.

Bug-AGL: SPEC-5061

Change-Id: I2e7e6d976663a41d0a53866d6bde4df0531f1790
Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
6 weeks agosrc: weston_compositor_load_backend now returns backend
Denys Dmytriyenko [Wed, 31 Jan 2024 00:04:13 +0000 (19:04 -0500)]
src: weston_compositor_load_backend now returns backend

And since weston_compositor structure now doesn't provide backend
field, move it to the parent ivi_compositor structure.

Bug-AGL: SPEC-5061

Change-Id: Ia0463ecdf149172c67857131530fc42e56fe5190
Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
6 weeks agosrc: use weston_coord_* structures
Denys Dmytriyenko [Wed, 31 Jan 2024 00:04:07 +0000 (19:04 -0500)]
src: use weston_coord_* structures

Offsets and coordinates are now handled and passed around via
corresponding weston_coord_* structures.

Bug-AGL: SPEC-5061

Change-Id: Ifa6958cce71eca80e4412545c3542842cd4d64da
Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
6 weeks agomeson.build: update for weston 13
Denys Dmytriyenko [Fri, 26 Jan 2024 17:57:51 +0000 (12:57 -0500)]
meson.build: update for weston 13

Bug-AGL: SPEC-5061

Change-Id: If56c7121b48ab5f826534e3dc538052f4bdef1ac
Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
6 weeks agocompositor: Fix building when x11 is not enabled
Marius Vlad [Wed, 20 Sep 2023 16:33:40 +0000 (19:33 +0300)]
compositor: Fix building when x11 is not enabled

This is just an aftermath of the change in 'meson.build, src: update for
weston 12' which missed up the change for not having the x11 backend.

Bug-AGL: SPEC-4578
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Iff2112ece5d378d7d9f8fe67ed05bd9c5d354155

6 weeks agomeson.build, src: update for weston 12
Marius Vlad [Thu, 7 Sep 2023 19:29:20 +0000 (15:29 -0400)]
meson.build, src: update for weston 12

Update dependencies for libweston-12 in meson.build, as well as
adjust sources due to libweston-desktop/libweston-desktop.h
moving to libweston/desktop.h

This adds support libweston 12 which includes the following changes:

- use MODULEDIR, for both weston and libweston when loading
- use backend, renderer when starting up and pass those up

Bug-AGL: SPEC-4578

Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I269e877ee3ae8cf8f1447bda05e11422244a416e

6 weeks agosrc: Make sure we don't die out when performing output hot-plugging
Marius Vlad [Thu, 1 Dec 2022 15:32:59 +0000 (17:32 +0200)]
src: Make sure we don't die out when performing output hot-plugging

Bug-AGL: SPEC-4617
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I3147cbfbc5a5c3913d8e361b907f5c19bf539276

6 weeks agomeson.build, src: update for weston 11
Marius Vlad [Thu, 1 Dec 2022 11:18:53 +0000 (13:18 +0200)]
meson.build, src: update for weston 11

Bump Weston library dependencies to work with Weston 11.0.0.

The following changes are needed to port the compositor to the
latest changes from libweston 11.

Specifically we now use weston_surface_unref() instead of
weston_surface_destroy(). The weston_head parameter is now needed
when creating an output in weston_compositor_create_output().

We now use weston_buffer_create_solid_rgba() instead of
weston_surface_set_color() to create our black curtain. A further
upstream updates has been added to include some of the shell-utils
wrapper but we'll get those in the next release of libweston.

Finally, in order to attach heads and enable the outputs, we need to
start from 1, rather than 0, and we now need lazy output placement for
multiple outputs, following basically what weston is doing.

Bug-AGL: SPEC-4578
Bug-AGL: SPEC-4617

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ie4aa7bc09b99d85b6bda49437c5f4789012244e1

6 weeks agomeson.build: Fix wayland-scanner detection
Scott Murray [Sun, 20 Nov 2022 22:58:27 +0000 (17:58 -0500)]
meson.build: Fix wayland-scanner detection

Update wayland-scanner dependency to mark it as native, as detection
fails with newer meson without it.  This also matches what is done in
Weston's meson.build.

Bug-AGL: SPEC-4578

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
2 months agomeson.build: Do another version bump 15/29715/1
Marius Vlad [Fri, 23 Feb 2024 16:56:07 +0000 (18:56 +0200)]
meson.build: Do another version bump

To include a quick fix regarding building the compositor
with rdp backend support.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I2611af2b867285b5529dbcdeceed4bfd2869ec9b

2 months agocompositor: Avoid compiler warning and build failure 14/29714/1
Marius Vlad [Fri, 23 Feb 2024 16:55:05 +0000 (18:55 +0200)]
compositor: Avoid compiler warning and build failure

This is because we build with warns as failures and possibly the rdp
backend loading isn't enabled.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ia184b1a6fa2ec25b07329f10777c9d47451d53fe

2 months agomeson.build: Bump version to 0.22.3 08/29708/1
Marius Vlad [Fri, 23 Feb 2024 16:10:21 +0000 (18:10 +0200)]
meson.build: Bump version to 0.22.3

We've added split type of functionality with support for loading the RDP
backend, such that this warrants an version update as well.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I28e35f53bb1d9a9d3deed204596bd8ef090cb579

2 months agocompositor: Add support for loading width/height/transform 96/29696/2
Marius Vlad [Wed, 21 Feb 2024 12:52:22 +0000 (14:52 +0200)]
compositor: Add support for loading width/height/transform

From the ini configuration file.

Bug-AGL: SPEC-5077
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I12e47844771494f72db5e387d468bef70ceb5edf

2 months agomain-grpc: Fix iterator going invalid at destruction time 95/29695/2
Marius Vlad [Wed, 21 Feb 2024 08:44:54 +0000 (10:44 +0200)]
main-grpc: Fix iterator going invalid at destruction time

Apparently, erase() would make the iterator invalid so we need grab
the next one to have the work correctly.

Bug-AGL: SPEC-5077
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I290fa1231eb6b37ab63c5f5c0bd8fe90d4363a77

2 months agocompositor: Add the ability to load rdp-backend.so 93/29693/3
Marius Vlad [Fri, 16 Feb 2024 09:13:58 +0000 (11:13 +0200)]
compositor: Add the ability to load rdp-backend.so

Similar to Weston this loads the backend-rdp shared library.

Bug-AGL: SPEC-5077
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ib4e1d408fbb7e1eb0a09135c85a3275d424f7015

2 months agolayout/shell: Keep track of previous role 80/29680/2
Marius Vlad [Wed, 14 Feb 2024 11:26:44 +0000 (13:26 +0200)]
layout/shell: Keep track of previous role

And with it also handle the re-mapping/unmapping of previous active
window such we don't run into weird behaviours, and be able to revert
back to the original output dimensions when going back to normal
windows.

Bug-AGL: SPEC-4839
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I3703de998b0baa8a2b9d72276dcd56b315d3ca1a

2 months agolayout: Added sticky implementation for split windows 79/29679/2
Marius Vlad [Mon, 12 Feb 2024 12:13:05 +0000 (14:13 +0200)]
layout: Added sticky implementation for split windows

This continues implementing the sticky window functionality to
be able to keep a window, set as sticky, always displayed while
having the ability to activate/switch to other windows.

This could be useful in a handful of sitauations like keeping the nav
application on, while activing other windows.

Bug-AGL: SPEC-4839
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I94c835c0d8f9f7e334e4c75389d78bd267b71a87

2 months agoshell/layout: Add implementation for the width param 55/29655/3
Marius Vlad [Fri, 9 Feb 2024 10:11:14 +0000 (12:11 +0200)]
shell/layout: Add implementation for the width param

This adds support for passing by the width argument such that users can
specify the width dimensions of the split window. Given that we might
another previous active window we also need to split that accordingly
depending on the orientation.

Bug-AGL: SPEC-4839
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I39239c1af0358eaa671146d0f36a3a334e945067

2 months agosrc: Don't attempt to split background role window 54/29654/3
Marius Vlad [Wed, 7 Feb 2024 15:46:15 +0000 (17:46 +0200)]
src: Don't attempt to split background role window

If that window is a background one, this patch avoids doing that. The
background surface role needs to always be available. Discovered while
testing it out with flutter embedder.

Bug-AGL: SPEC-4839
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ia46b7ae590ea4feafa8a67efeb8ad540f6d2dfa0

2 months agogrpc-proxy/shell: Add sticky parameter when setting up split window 49/29649/4
Marius Vlad [Wed, 31 Jan 2024 17:10:34 +0000 (19:10 +0200)]
grpc-proxy/shell: Add sticky parameter when setting up split window

This allow to further customize how to handle the split window.

There's no implementation in the compositor for allow this functionality
to take place, but doing so can be at a later point in time.

Tagging the split window as sticky should allow activation of other
windows while keeping the split window always displayed.

Bug-AGL: SPEC-4839
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Iae4d18d2a857497c11d0e77bf43f654e2b8ed501

2 months agogrpc-proxy/shell: Add width for split window 48/29648/4
Marius Vlad [Wed, 31 Jan 2024 12:15:02 +0000 (14:15 +0200)]
grpc-proxy/shell: Add width for split window

It might be useful in the future to let clients choose how much of the
window to split so allow passing that. Note that there's no actual
implementation but if there's a need in the future it can be easily
added so it's better to add this now.

Bug-AGL: SPEC-4839
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I82f36e86f56b0a65cbacac8368b63f68df69a350

2 months agolayout/shell: Reset split type of windows 16/29616/6
Marius Vlad [Tue, 30 Jan 2024 15:34:24 +0000 (17:34 +0200)]
layout/shell: Reset split type of windows

This change would reset to default (none) orientation when activating a
different window, than those split and currently active.

The use-case is that when activating a different window all previous
split ones would reset to their original state (none orientation), such
that when the user tries to activate any former split windows it would get
the window without being split plus the other active window in the same
time. IOW going back and activating an former split window would also
display the other window which would complicate things a bit.

Bug-AGL: SPEC-4839
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I315d42b656962bf3f68f140466ab58429a0e972c

2 months agoshell: Reset active view to allow further activation 15/29615/6
Marius Vlad [Tue, 30 Jan 2024 14:10:35 +0000 (16:10 +0200)]
shell: Reset active view to allow further activation

Going back to regular, with a none orientation would allow to re-activate the
window. This wouldn't happen because we haven't been able to reset
the active window

Keeps things sane for the user and would allow navigating back to
those windows. Further patches should improve and avoid this entirely if
the split window is sticky.

Bug-AGL: SPEC-4839
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ic2cc7fd2839f5a664957d3f111c400559d93cf3f

2 months agolayout: Specify the reason for not activating windows 14/29614/6
Marius Vlad [Tue, 30 Jan 2024 13:33:01 +0000 (15:33 +0200)]
layout: Specify the reason for not activating windows

Rather than guessing why the windows do not activate.
Found some use cases where this would be useful to be explicit.

Bug-AGL: SPEC-4839
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I65383f8b3467f3b3093786907b194dce3cf635af

2 months agogrpc-proxy: Extend AglShellSetSplit from gRPC proxy 13/29613/6
Marius Vlad [Thu, 25 Jan 2024 17:52:53 +0000 (19:52 +0200)]
grpc-proxy: Extend AglShellSetSplit from gRPC proxy

This adds an implementation for it and includes the output name,
previously being missed.

Bug-AGL: SPEC-4839
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I95181adebe1ff6cddf81796444774277fec28a9a

2 months agolayout/shell: Add basic support for split window 12/29612/6
Marius Vlad [Thu, 25 Jan 2024 16:55:15 +0000 (18:55 +0200)]
layout/shell: Add basic support for split window

This introduces a new set_split request to allow changing the tile
orientation of the window. See the protocol XML for more implementation
details.

Of importance difference from the previous implementation is that
this patch makes use of the xdg-shell protocol, such that orientation
is being handled over the configure event to the client.

The protocol specifies a width to allow the client to control how much
of the output be assign the split window and also a sticky window
functionality.

Bug-AGL: SPEC-4839
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ia8b7d04a7514f55d647c3ea76b13bab51a3586aa

2 months agoAdd gitlab issue/merge request templates 17.90.0 ricefish/17.90.0 ricefish_17.90.0
Jan-Simon Moeller [Tue, 13 Feb 2024 22:01:49 +0000 (23:01 +0100)]
Add gitlab issue/merge request templates

Add template files for gitlab

Bug-AGL: SPEC-4474
Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Change-Id: I811994c1179932fe83a6b5f1ceb674f65ec1c568

3 months agolayout: Add the ability to deactivate fullscreen surfaces 08/29608/1
Marius Vlad [Tue, 23 Jan 2024 13:39:47 +0000 (15:39 +0200)]
layout: Add the ability to deactivate fullscreen surfaces

Deactivating fullscreen is a special case so we need to handle it
similarly to dialog/popups.

This adds an additional schedule for repaint in the fullscreen part to
force a redraw, otherwise deactivation/activation would need to inflict
any sort of damage to trigger a redraw.

Bug-AGL: SPEC-4348
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I258543f43514af07dfed7b36531816e90561cc61

3 months agogrpc-proxy: Add a prefix tag for debugging messages 73/29573/1
Marius Vlad [Tue, 2 Jan 2024 17:28:38 +0000 (19:28 +0200)]
grpc-proxy: Add a prefix tag for debugging messages

Bug-AGL: SPEC-4977
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ib26d0b9f9d47e7d2e2d42b47a9702ba31d03f3b9

3 months agogrpc-proxy: Re-work bound_ok/bound_fail events handling 67/29567/4
Marius Vlad [Fri, 29 Dec 2023 20:16:37 +0000 (22:16 +0200)]
grpc-proxy: Re-work bound_ok/bound_fail events handling

This bigger patch changes the way gRPC proxy client connects to the
server, more specifically how it binds to the same agl_shell interface
as the shell client.

I debated if this should be split into more pieces but I think it makes
more sense to have contained into a single patch as it doesn't make
sense to have some bits off and some bits on, as both the server and the
client side need to be changed at the same time.

This biggest change with this patch is to avoid a potential race condition
between the gRPC proxy client and the shell-client, but also to simplify
the way the gRPC client connects to the server as there aren't sufficient
guards in the server to the provent various corner cases to take place.
Rather than attempting to fix that, simplifying the entire bit and
allow only a single agl-shell client and a sigle gRPC proxy client
connected at a single time and remove any other potential clients
trying to connect at all, later on.

Context and usage:

Both the gRPC proxy and shell-client bind to the same agl_shell
interface, meaning that both use the shell-client (homescreen,
flutter-ics-homescreen, flutter-auto, wam) and the gRPC proxy can
issue agl_shell requests, with some minor differences --
setting background and panels which do not make sense for
gRPC proxy client.

The compositor can signal back to clients when a bind was OK or
not with the bound_ok/bound_fail event. Previously to
adding the bound_ok/bound_fail events, any other client trying to use
agl_shell interface, more than once, would get a protocol violation.
With the bound_ok/bound_fail events clients would instead receive this
event and could theoretically act upon it.

The race that this patch tries to overcome is that the gRPC client will
periodically attempt to verify if there's a shell-client already
connected to server by binding to agl_shell interface and waiting for
bound_fail event. In case it got bound_ok, it would disconnect and
attempt at latter point in time, until it got the bound_failed event, and thus
signalling that there's shell client already connected, allowing to
proceed further.

This worked fine most of the time, depending on how fast the shell
client also bind to agl_shell.  For a brief period of time, it might be
that shell client also gets a bound_fail, requiring it to retry at a
later point in time. The disconnected/reconnect of the gRPC proxy would
then complicate matters as the client resources will get overwritten. So
rather than trying to try that fix that, a better approach is to
simplify the way this works entirely.

The change in this patch is that the gRPC proxy doesn't
connect/disconnect periodically but rather it waits for the compositor
to signal when it is ready to bind to agl_shell interface.

That happens with the help of the doas event status, from the
agl_shell_ext interface. If this event status is alright (OK) then it means
the gRPC can then bind to agl_shell interface.

If it gets a failed status it would just wait and then issue another
doas request and continue as such forever until it got an alright
status. The distinct is that in this case the gRPC proxy would not disconnect
and then reconnect retrying the same thing.

This change to simplify some of the assumption in server, and
client side implementation would just race with the shell client when
binding to the agl_shell interface.

Bug-AGL: SPEC-4977
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ib74f789553d3b130ee8e61d0068e617dc2209a58

4 months agoshell: Provide a better explanation for terminating the connection 48/29548/1
Marius Vlad [Tue, 19 Dec 2023 14:24:05 +0000 (16:24 +0200)]
shell: Provide a better explanation for terminating the connection

And make sure we clear off the remaing client resources when doing an
unbind.

It seems we would hit it when checking set_background/ready/set_panel
requests, resulting in a protocol violation and finally terminating the
connection.

Bug-AGL: SPEC-4977
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ie5ed881511ec2ac4501d2a5cac349abc7f83c1fe

4 months agoshell: Don't assume an output previously set-up 35/29535/1
Marius Vlad [Fri, 15 Dec 2023 10:21:49 +0000 (12:21 +0200)]
shell: Don't assume an output previously set-up

This is unlikely to happen in practice, but discovered while doing a
code audit, so let's let be on the safe side and don't attempt to deref
as we'll get invalid memory.

Bug-AGL: SPEC-5018
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ib874a7194ab3a7019a304ec4c1974824c78b26cc

5 months agomeson.build: Bump version to 0.0.22 02/29402/1
Marius Vlad [Tue, 14 Nov 2023 10:15:10 +0000 (12:15 +0200)]
meson.build: Bump version to 0.0.22

We haven't add an official release since the beginning of the year, when
we introduced the gRPC API. So do another one, as we've changed a bit
the say the gRPC starts.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Idc2feace89a0cd77d1788e629fff9b5f2f443fce

5 months agogrpc-proxy: Use smaller waiting time 06/29306/2
Marius Vlad [Wed, 25 Oct 2023 13:22:19 +0000 (16:22 +0300)]
grpc-proxy: Use smaller waiting time

This would speed the time checking if agl-shell was bounded or not.
Shouldn't make that much of a difference but we do not need to wait 250
ms just for testing that.

Bug-AGL: SPEC-4912
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I8751c1d69898a82a415ba9b756bdfe9657ef0546

5 months agogrpc-proxy: Start the gRPC server and waiting thread much sooner 05/29305/3
Marius Vlad [Tue, 24 Oct 2023 14:39:45 +0000 (17:39 +0300)]
grpc-proxy: Start the gRPC server and waiting thread much sooner

This change moves a bit the start-up sequence of the gRPC server and
when it connects to the compositor.

Changing the start-up sequence avoids waiting for the channel to change
its state from disconnected to connected, and only wait for the wayland
connection to take place. Otherwise, we would wait first for the wayland
connection to take place, then wait for the gRPC server to start up
and finally wait for the channel to be in connected state, all which
would incur a massive waiting time.

Moving it a bit early requires to at least verify that we have the proxy
side (the wayland connection) is already set-up at that time.

Bug-AGL: SPEC-4912
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ied88a917df8ff98fefa601103ce04e13c8bb21ac

5 months agogrpc-proxy: Fix missing args LOG() 04/29304/2
Marius Vlad [Tue, 24 Oct 2023 14:11:12 +0000 (17:11 +0300)]
grpc-proxy: Fix missing args LOG()

These are not seen until enabling the DEBUG directive.

Bug-AGL: SPEC-4912
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ic18c701909975978e82ef811ade416d802e567b5

6 months agogrpc-proxy/main-grpc: Don't fall trough assuming we have a wl_display 17/29317/3
Marius Vlad [Fri, 27 Oct 2023 13:16:19 +0000 (16:16 +0300)]
grpc-proxy/main-grpc: Don't fall trough assuming we have a wl_display

Maybe the third time is a charm to avoid fall through and assume on the
exit path we do have a wl_display.

Bug-AGL: SPEC-4935
Reported-by: Lisandro Pérez Meyer <lpmeyer@ics.com>
Tested-by: Lisandro Pérez Meyer <lpmeyer@ics.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I4adef5bf72d6b1a32a218bf1cfa6c8ed4450ba48

6 months agogrpc-proxy: Don't attempt to connect if there's no compositor running 13/29313/1
Marius Vlad [Fri, 27 Oct 2023 10:52:09 +0000 (13:52 +0300)]
grpc-proxy: Don't attempt to connect if there's no compositor running

Commit d8e72099ecbcad, 'grpc-proxy: Terminate thread when we're
exiting', addressed a rather bigger issue to handle correctly the
shutdown/restart sequence. A consequence of that is the initial issue
opened in SPEC-4935 with a trace showing a protocol issue, due to fact
we're supplying an invalid wl_display without being connected to the
compositor.

While commit d8e72099ecbcad, 'grpc-proxy: Terminate thread when we're
exiting' does fix the issue and would make the underlying bug disappear
let's be more pedantic and don't attempt assume we have a compositor
connection when in fact we do not.

Bug-AGL: SPEC-4935
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Id10dabe5178f52fa6a0cf6d70c70799c98f4b6d5

6 months agogrpc-proxy: Terminate thread when we're exiting 01/29301/1
Marius Vlad [Tue, 24 Oct 2023 13:51:59 +0000 (16:51 +0300)]
grpc-proxy: Terminate thread when we're exiting

We need to be joining the thread to be able to exit properly, so let us
do that.

Bug-AGL: SPEC-4935
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ib4e54fcb23267b632f61c10d6ec2835c55ec2f23

7 months agogrpc-proxy: Add dynamic scale of floating windows 69/29069/2
Marius Vlad [Mon, 31 Jul 2023 11:41:48 +0000 (14:41 +0300)]
grpc-proxy: Add dynamic scale of floating windows

This adds basic scaling for floating windows, sending new dimensions to
the clients to resize itself.

Bug-AGL: SPEC-4862
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ic693153cd704b278dcddd2514afc8dafecf8829b

7 months agogrpc-proxy: Add dynamic floating window movement 68/29068/2
Marius Vlad [Thu, 27 Jul 2023 13:37:15 +0000 (16:37 +0300)]
grpc-proxy: Add dynamic floating window movement

This adds basic movement for floating type of windows. The window needs
to be a floating type for this request to work out.

For the agl-shell protocol, this adds a set_app_float() request while
for gRPC it adds a SetAppPosition() request.

Bug-AGL: SPEC-4863
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I5ecc4257c3e84d15a8cabb183757753be37867f5

8 months agodesktop: Fix Xwayland build 40/29140/1
Marius Vlad [Thu, 17 Aug 2023 11:59:24 +0000 (14:59 +0300)]
desktop: Fix Xwayland build

Turns out weston doesn't install xwayland-api header if Xwayland is not
installed, which is a shame, and should be rectified. Meanwhile, let's
guard access to the header and the API that the header exports.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I77638b263483628f8cc7a3dcbd08c8947db1d86b

8 months agocompositor: Use the logging context when iterating over scopes 65/29065/2
Marius Vlad [Mon, 24 Jul 2023 17:24:33 +0000 (20:24 +0300)]
compositor: Use the logging context when iterating over scopes

In accordance to the upstream changes refer to the logging context
rather than the compositor instance.

Depends on https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/29064

Bug-AGL: SPEC-4861
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I4a8aeac4ef33e0631c23ae85347fea8a1b36c4de

9 months agolayout: Check against app_id being valid 62/29062/1
Marius Vlad [Fri, 21 Jul 2023 16:38:19 +0000 (19:38 +0300)]
layout: Check against app_id being valid

All app_ids are not valid for xwayland type of surfaces to need to check
against it.

Bug-AGL: SPEC-4847
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I84dc9b493648f4fe48b1c23c8ead0283505acce0

9 months agolayout: Determine xwayland surface in a generic fashion 61/29061/1
Marius Vlad [Fri, 21 Jul 2023 12:37:49 +0000 (15:37 +0300)]
layout: Determine xwayland surface in a generic fashion

This provides a far better way of determining if the surface is
xwayland or not. We can then make sure all X11 clients can be displayed.

Bug-AGL: SPEC-4847
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I2140c452c0d37a84323eaf75787eb32a7771a56e

10 months agocompositor: Add XWayland basic support 74/28874/3
Marius Vlad [Mon, 8 May 2023 16:20:25 +0000 (19:20 +0300)]
compositor: Add XWayland basic support

This allow starting up XWayland and the ability to display, albeit
is incomplete, given that we have no way at this moment to make the
window maximized, as we do with xdg-shell/native wayland applications.

A further patch, together with libweston changes are needed to make this
complete. For now this can provide us with initial smoke testing. Tested
with basic X11 clients, including Unigine, which is the reason for
having this the moment.

Note that this at the moment compiled-out, requiring the pass
-Dxwayland=true when building the compositor.

Bug-AGL: SPEC-4782
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I87d2a852165cb3f03482bea1e04931bdd6d4c115

10 months agolayout: Give ini config precedence over agl_shell 12/29012/1
Marius Vlad [Tue, 13 Jun 2023 11:04:40 +0000 (14:04 +0300)]
layout: Give ini config precedence over agl_shell

The activation area can set-up with agl_shell as well, so give
the ini configuration file precedence over the one set-up by
agl_shell.

Bug-AGL: SPEC-4829
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ifae82b8c29575e7a9a06422588ad6a8cce80946e

10 months agoshell: Don't reset the activation area always 11/29011/1
Marius Vlad [Tue, 13 Jun 2023 10:47:19 +0000 (13:47 +0300)]
shell: Don't reset the activation area always

Rather than doing that always, be more selective, and perform it if we
had already an application active.

Bug-AGL: SPEC-4829
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I707f92d1cc1f820af493bae9daa5a948aa452ad8

10 months agolayout: Add a fallback for reading activation-area 10/29010/1
Marius Vlad [Fri, 9 Jun 2023 08:49:36 +0000 (11:49 +0300)]
layout: Add a fallback for reading activation-area

This is a temporary work-around for doing another read of the ini file
for the activation-area in case we detected that we have one set-up but
the activation area is empty. This happens when we're getting the ready()
request from the shell client, when we're initializing the layout.

Bug-AGL: SPEC-4829
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I152e7cba34b74390de2a46df4799c1fb44441d3f

10 months agopolicy-deny: Remove SMACK support 24/28924/2
Marius Vlad [Tue, 23 May 2023 12:58:31 +0000 (15:58 +0300)]
policy-deny: Remove SMACK support

Similar to Waltham, SMACK hasn't been really used and it was actually
a compile option, showing as a example the deny policy. The RBA and the
allow-all policy still available, and we can revisit the policy
mechanism if we plan on switching to SELinux.

Bug-AGL: SPEC-4806
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Iedac63585676ebc47201debcf73870cb0538cc09

10 months agocompositor: Remove Waltham support 23/28923/2
Marius Vlad [Tue, 23 May 2023 12:48:56 +0000 (15:48 +0300)]
compositor: Remove Waltham support

Waltham hasn't been used in a while, its support has been removed for
some time, we've been deprecating it last release so it's time to remove
it from the compositor as well.

Bug-AGL: SPEC-4669
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Iaf1e467b1228051fd96cac424ac6781d67f9fefa

11 months agoclients/screenshooter: Add the output name to screenshot name 92/28892/1
Marius Vlad [Fri, 12 May 2023 18:51:32 +0000 (21:51 +0300)]
clients/screenshooter: Add the output name to screenshot name

And split the screenshot in multiple files, to match each output.

Bug-AGL: SPEC-4788
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I6d9e545c05ff949900f0158720888eb757c2c271

11 months agocompositor: Let the user know about the debug scopes available 03/28803/1
Marius Vlad [Thu, 4 May 2023 15:01:16 +0000 (18:01 +0300)]
compositor: Let the user know about the debug scopes available

Bug-AGL: SPEC-4593
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I79d4447b7768b72712e244504782a33ba257a33d

11 months agocompositor: Add support for subscribing to libweston scopes 02/28802/1
Marius Vlad [Thu, 4 May 2023 11:42:56 +0000 (14:42 +0300)]
compositor: Add support for subscribing to libweston scopes

This brings in support to pass, over the command line, debug scopes
that can help out debug issues with HW with other components or with
libweston itself. One particular importance is the drm-backend debug
scope.

Bug-AGL: SPEC-4593
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I7a182ffe0b2b9bfdeced184514283265bb17c607

11 months agoshell: Add the ability to dynamically move application window 24/28724/3
Marius Vlad [Wed, 26 Apr 2023 06:48:40 +0000 (09:48 +0300)]
shell: Add the ability to dynamically move application window

So far, we could start an application on a different output, but
moving them back-and-worth wasn't really supported. This handles
a few use-cases like:

- move an application's window from one output to another
- install black curtain in case we no longer have any other surfaces
  on that output;
- deactivate and switch to the previous active window in case there's
  one available
- the activation is handled by the shell client, while deactivation
  is done implicitly by the compositor to simplify the shell client

This does a bit of rewording of a function that returns true whenever
we have only a single application window on a particular output.

Bug-AGL: SPEC-4673
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I58cde58c6a2e2dade93566bfd7aff5ed697f5450

11 months agolayout: Fix no-op check due to invalid checks 23/28723/2
Marius Vlad [Wed, 26 Apr 2023 06:49:08 +0000 (09:49 +0300)]
layout: Fix no-op check due to invalid checks

Checking both width and height isn't a strict requirement, either can
different. This unties the check such that we can actually move
windows/applications between different outputs.

We also add here an explicit surface damage as we're removing the view
from the layer.

Bug-AGL: SPEC-4773
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ie91b8c0fd2e9357fe00fd693e2a70fa3b4b4d31a

11 months agodesktop: Look for app_ids after the initial commit 87/28687/4
Marius Vlad [Fri, 21 Apr 2023 11:38:32 +0000 (14:38 +0300)]
desktop: Look for app_ids after the initial commit

Some applications, set up their app_ids after the initial surface
commit, which is too late to move them/place them to a different output.

This addresses that in the case the application sets one up, after the
initial surface commit.

Bug-AGL: SPEC-4759
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I4762af1ba6e8708722385ac06c37486dd4b6aac1

11 months agosrc: Send out the output name for the remote role 43/28643/6
Marius Vlad [Fri, 14 Apr 2023 13:46:06 +0000 (16:46 +0300)]
src: Send out the output name for the remote role

A while ago we switched to activation-by-default turned off which passes
the responsability of activating applications to the shell client. The
shell client uses the app_id to indentify the application to display,
and the output.

The output would normally be hard-coded to the first available output
but there is nothing that prevents the shell to display it on other
outputs.

This patch does just that, it would allow the user use configurable
option in the ini file, under the [output], agl-shell-app-id=app_id, by
re-using the event from the compositor sent to the shell client to
pick up a different output, the one specified in the section entry.

Bug-AGL: SPEC-4529
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ieea1a28fe6776ecc691fd38da9b4c3495ac5a5ea

12 months agolayout: Split remote from desktop role 42/28642/4
Marius Vlad [Thu, 13 Apr 2023 08:58:19 +0000 (11:58 +0300)]
layout: Split remote from desktop role

Though there's no difference between the desktop and remote role this
would simplify handling, and with it we remove the implicit activation
of surfaces, which wasn't addressed when we switched to
activate-by-default=false by default.

Bug-AGL: SPEC-4673, SPEC-4759, SPEC-4529, SPEC-4756
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ia5e57155ed26c53958e0e9590be04f91c5de1c28

12 months agogrpc-proxy: Added set_app_output request 41/28641/2
Marius Vlad [Fri, 7 Apr 2023 12:59:49 +0000 (15:59 +0300)]
grpc-proxy: Added set_app_output request

This is identical to the remote role, but I feel this conveys more
information than remote role, as remote denotes that the output is
displayed on another device, which it isn't always the case (the
system has multiple outputs all connected directly).

This introduces two new additions to the agl-shell protocol, a request
to use a different output to display/show the application and an event
to inform the shell client to use as a map between the application id
and its output. The event is necessary to let the shell client know
which output to activate the application on.

This requests implements a wrapper for gRPC that maps 1-to-1 to the
agl-shell request. There's no gRPC subscription similar to the event
though.

Bug-AGL: SPEC-4673
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I070e9fdbafd5616f3a98415193bf846aeaee9a4a

12 months agocompositor: Don't reuse previous return values 25/28625/1
Marius Vlad [Thu, 6 Apr 2023 07:59:37 +0000 (10:59 +0300)]
compositor: Don't reuse previous return values

In case we couldn't enable the output do not return early without
setting the proper return value. This causes an issue later one, because
the signal list isn't initalized, taking down the compositor with a crash.

Bug-AGL: SPEC-4734
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ia5ebc226f6b8f702e710a5976c471d04302bcb00

13 months agomeson.build: Add an explicit weston dependency 73/28573/1
Marius Vlad [Wed, 15 Mar 2023 10:48:21 +0000 (12:48 +0200)]
meson.build: Add an explicit weston dependency

Required when building the compositor locally, without yocto/OE as
weston cflags includes the full path to weston.

Bug-AGL: SPEC-4725
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: If3a4e8238cb40c6fbe0db26bd1056fce48243038

13 months agomeson.build: Remove any prefix assumptions 72/28572/1
Marius Vlad [Sat, 11 Mar 2023 17:02:26 +0000 (19:02 +0200)]
meson.build: Remove any prefix assumptions

This forces to create a include directory by hand, which we don't seem
to be needing. This only affected the cases where we build the
compositor locally, without yocto/OE.

Bug-AGL: SPEC-4725
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ic279714671809eae2362da9fccaf592f10f2b888

13 months agogrpc-proxy: Add set_app_fullscreen functionality 52/28552/1
Marius Vlad [Wed, 1 Mar 2023 14:57:38 +0000 (16:57 +0200)]
grpc-proxy: Add set_app_fullscreen functionality

This implements set_app_fullscreen which clients can set-up before being
mapped.

The worthwhile change here was the fact that transitioning between
fullscreen, normal, and float would cause invalid tracking of the active
window when switching between these states. This would make floating
operation display the incorrect active window, so in order to reconcile
that, we only update the previous surface if it is different that the
current active one. Otherwise this fairly similar to set_app_float.

Bug-AGL: SPEC-4673
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ie912c86ff7ac38d034cf4d97b2adbc5ef47ce9d3

13 months agoshell: Reset normal state when getting back to maximized 51/28551/1
Marius Vlad [Thu, 2 Mar 2023 17:05:51 +0000 (19:05 +0200)]
shell: Reset normal state when getting back to maximized

When resetting back to normal, maximized state, reset also the state,
just in case we might to check it up latter on.

Bug-AGL: SPEC-4673
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I0107e6963c01bde22a5a3ab30f392cb618a4f258

13 months agoprotocol: Add set_app_normal request 65/28465/3
Marius Vlad [Thu, 9 Feb 2023 12:06:49 +0000 (14:06 +0200)]
protocol: Add set_app_normal request

This request allows transitioning back from other roles like
float/split/fullscreen to regular maximized, normal state.

Bug-AGL: SPEC-4673
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Id7f04ffee193677621bd32860998457498acc388

13 months agoprotocol, grpc-proxy: Add support for set_app_float 64/28464/3
Marius Vlad [Fri, 20 Jan 2023 14:32:35 +0000 (16:32 +0200)]
protocol, grpc-proxy: Add support for set_app_float

Add support for setting a window as float/popup. This allows either the
application itself be set-up as float, or from other gRPC clients.

Bug-AGL: SPEC-4673
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ic7ee8203cd9c4dfcc51b7fc9709f35be504ae9d0

13 months agoprotocol/grpc-proxy: Add deactivate_app request 63/28463/2
Marius Vlad [Fri, 20 Jan 2023 11:34:00 +0000 (13:34 +0200)]
protocol/grpc-proxy: Add deactivate_app request

This request will hide the currently active window, and activate
either the background or the previously active window.

This request mimics the agl-shell-desktop request, actually using the
same code path. It only handles regular windows and float/pop-up. Once
we add other roles like fullscreen/split we can improve on this.

Bug-AGL: SPEC-4673
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I593cda5d008dfc32fe5e3b079fad9450dc1a490d

14 months agocompositor: Added layout_save/layout_restore 05/28505/1
Marius Vlad [Wed, 15 Feb 2023 15:02:28 +0000 (17:02 +0200)]
compositor: Added layout_save/layout_restore

In order to send correct dimensions after a hot-plug event, we need to
be able to save the area we had before.

Note that implies that the connectors do not change names in between
hot-plugs, which normally doesn't happen, but it might if udev rules are
executed/invoked. We restore based on output name it had previously.

Bug-AGL: SPEC-4705
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ice3a127edfc9d356830ba8f0d0a20bb86284d7de

14 months agoshell: Check for a valid ivi_surface 04/28504/1
Marius Vlad [Wed, 15 Feb 2023 15:49:50 +0000 (17:49 +0200)]
shell: Check for a valid ivi_surface

A hot-plug/re-plug event means we remove the black curtain with it the
ivi_surface that hangs out of it, so verify it before assuming there's
one installed.

Bug-AGL: SPEC-4705
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Iad53ae34b4e15b5962cf984978a65c344aac9200

14 months agoshell: Check for invalid outputs passed on when activating 03/28503/1
Marius Vlad [Wed, 15 Feb 2023 10:19:42 +0000 (12:19 +0200)]
shell: Check for invalid outputs passed on when activating

Connector hot-plugging would generate new wl_output object, which the
client might re-use so rather than blindly trusting the client, make
sure that the output we're getting is really one suitable.

This should avoid getting an incorrect output upon re-plugging in a
connector.

Bug-AGL: SPEC-4705
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I732283fc16841e0e57ddbec5d8bd2333d5028433

14 months agocompositor: Fix memleak when disabling the output 02/28502/1
Marius Vlad [Wed, 15 Feb 2023 15:07:09 +0000 (17:07 +0200)]
compositor: Fix memleak when disabling the output

Turns out we're leaking out the app_ids when disabling the output so
turn that memleak off.

Bug-AGL: SPEC-4705
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ia2d46ecd1748c078e924d8d6c90bd86e9c49f64c

14 months agoivi-compositor: Add support for multiple app_ids 79/28379/3
Marius Vlad [Wed, 11 Jan 2023 15:23:37 +0000 (17:23 +0200)]
ivi-compositor: Add support for multiple app_ids

Verify if more than one app_id is being passed in the agl-shell-app-id
to allow more than one appid being placed to that output.

Bug-AGL: SPEC-4666
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I79dc77564ffca41148832af597b6836d7d28f686

14 months agomeson: Deprecate waltham and inform users of that 78/28378/3
Marius Vlad [Wed, 11 Jan 2023 12:48:06 +0000 (14:48 +0200)]
meson: Deprecate waltham and inform users of that

Waltham isn't really used, this is a step forward removing
support for it. For now just add an configuration option if users still
want to use it.

Bug-AGL: SPEC-4670
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I5ec900ef075717b438ef9e41167ad4833b2a8b87

14 months agomeson: Bump to version 0.0.21 77/28377/2
Marius Vlad [Wed, 11 Jan 2023 13:05:02 +0000 (15:05 +0200)]
meson: Bump to version 0.0.21

We should probably cut and update the compositor to a newer version
as gRPC support is a big change to have.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Iac400a3d2f0e62c5fe3b2ab0f681ce228a1865db

15 months agoshell: Reset the area activation 85/28385/1
Marius Vlad [Sat, 14 Jan 2023 17:46:47 +0000 (19:46 +0200)]
shell: Reset the area activation

Re-starting the shell client wouldn't reset the activation area, which
might be rather confusing, so better be re-initialize it as to be able to
switch in-between various configurations.

Bug-AGL: SPEC-4674
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ib964ebed2c189f82092ffcf4d54dee2cf22093e1

15 months agoshell: Verify agl-shell version for bound_ok/bound_fail 62/28362/1
Marius Vlad [Wed, 4 Jan 2023 14:42:43 +0000 (16:42 +0200)]
shell: Verify agl-shell version for bound_ok/bound_fail

Some additional checks to avoid cases where agl-shell is still
using the version 1 but we're checking against at least version 2 (where
we introduced some additional events). Part of the compat series.

Bug-AGL: SPEC-4667
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I4f5d34fd8b9fe6cf6b8097948afebee550f5345d

15 months agoshell: Add fallback agl-shell version 1 61/28361/1
Marius Vlad [Thu, 5 Jan 2023 11:50:23 +0000 (13:50 +0200)]
shell: Add fallback agl-shell version 1

Turns out I made a mistake making all clients with version 1
not able to bind to agl-shell anymore. Rather than doing that still
allow older clients to bind to agl-shell.

Bug-AGL: SPEC-4667
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I61224f39dd8b0d96b36695f536eed8e701130877

15 months agoinput: Fix minor issue while reporting disable cursor 17/28317/1
Marius Vlad [Wed, 28 Dec 2022 15:59:36 +0000 (17:59 +0200)]
input: Fix minor issue while reporting disable cursor

We actually reported the cursor being disabled when it fact it was not.

Bug-AGL: SPEC-4658
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I81ee23e4ef2621c96344ce526a7b53d235d325e3

15 months agoinput: Rename hide-cursor to disable-cursor 16/28316/1
Marius Vlad [Wed, 28 Dec 2022 14:21:01 +0000 (16:21 +0200)]
input: Rename hide-cursor to disable-cursor

Since hide-cursor doesn't hide the cursor but disables the pointer,
better rename it to something much more appropriate.

While doing that, move also move the ini entry retrieval where is also
more suitable, along side the other parts that do that. Shouldn't be
any functional change while doing that.

Bug-AGL: SPEC-4658
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I8d1aab849b9a96177d17bb639c8e1e209205f7e7

16 months agosrc: Verify if the output is present 59/28259/5
Marius Vlad [Mon, 12 Dec 2022 19:02:19 +0000 (21:02 +0200)]
src: Verify if the output is present

The output destroy handler will invalidate the weston output and with it
we're no longer have access to it when the shell client closes up. This
checks against the weston output to avoid an illegal memory access.

Still part of the hot-plug connector fixes.

Bug-AGL: SPEC-4625
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Reported-by: Detlev Casanova <detlev.casanova@collabora.com>
Change-Id: Ic4c389422057fa082aff7fdbbc13af0c16f7bbb6

16 months agosrc: Further hotplug connector fixes 58/28258/4
Marius Vlad [Thu, 1 Dec 2022 16:37:02 +0000 (18:37 +0200)]
src: Further hotplug connector fixes

Some further checks for the black curtain not being present always when
perform hot-plugging operations.

Bug-AGL: SPEC-4625
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Reported-by: Detlev Casanova <detlev.casanova@collabora.com>
Change-Id: Ia7c05e5b90b9e8260f661a8115a93b0d246b9d98

16 months agogrpc-proxy: Init gRPC 71/28071/5 sandbox/mvlad/grpc-async-cb
Marius Vlad [Tue, 25 Oct 2022 10:06:41 +0000 (13:06 +0300)]
grpc-proxy: Init gRPC

This brings in support for accessing agl-shell protocol indirectly by
using a gRPC interface which bridges the communication between a
particular client (the client issuing gRPC requests) and the AGL
compositor which does that by re-using the same agl-shell protocol.

In order to achieve that, and further more, to avoid having ifdefs code
in the compositor and deal with threading, we instead resorted to using
a helper client.

On one side this helper implements the gRPC server API,
and on the other, a wayland native client that implements the
agl_shell interface.

It uses the agl_shell_ext interface added
previously to communicate with the compositor that it requires access
to agl_shell interface as well. The helper expects that agl_shell interface
was already bounded to another client before starting it so it waits
until that happens and then it implements the protocol specification,
for each interface.

Launching the helper client automatically can be done by adding the
following entry to the ini file:

[shell-client-ext]
command=/path/to/agl-shell-grpc-server

The gRPC server implementation only handles the agl_shell interface
until to this point, specifically, the activate_app request, and the
events that were adedd with version 3 of the agl-shell protocol.

Also the implementation uses the Reactor pattern, with Callback service
that greatly simplifies the async version and avoids putting locks to
to handle multiple clients. This should allow multiple clients being
connected to the gRPC server and receive events / send requests.

Bug-AGL: SPEC-4503
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ie870da3caa138394d8dd30f9d22a5552d585d63a

16 months agoshell: Not not override the agl_shell interface resources 70/28070/2
Marius Vlad [Wed, 26 Oct 2022 15:07:47 +0000 (18:07 +0300)]
shell: Not not override the agl_shell interface resources

This redoes a bit the way we assigned wl_resources created in case we got
a bound_ok or bound_fail event.

Previously, even if we get a 'bound_fail' event we would override the
shell_client.resource which would make activation of the legitimate
shell client impossible, so this change would make the shell_client.resource
not being set if that happens.

Secondly, this includes a reset change in the agl_shell destructor, a
reset which is implicitly being done when the correct operations for the
protocol specifications have been applied.

Bug-AGL: SPEC-4503
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ie87ce3b937f041a5704407593f580895f188ef56