src/agl-compositor.git
18 months agoAdd more grpc - Asyncstuff sandbox/mvlad/switch-to-grpc
Marius Vlad [Tue, 18 Oct 2022 17:22:47 +0000 (20:22 +0300)]
Add more grpc - Asyncstuff
Switch to a more better structure

protocol: Add support for sending out app_state events over gRPC

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

18 months agosrc/shell: Add a wrappers for sending events with agl-shell
Marius Vlad [Tue, 18 Oct 2022 20:32:40 +0000 (23:32 +0300)]
src/shell: Add a wrappers for sending events with agl-shell

As we now have one more (shell) client that can bind to agl-shell, add a
wrapper for sending the events and include it as well.

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

18 months agosrc: Allow to start other clients
Marius Vlad [Mon, 10 Oct 2022 14:03:15 +0000 (17:03 +0300)]
src: Allow to start other clients

With shell-client-ext is a new section entry to add to allow starting
the gRPC server helper client.

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

18 months agoclients/grpc: Initial start for gRPC proxy
Marius Vlad [Sun, 9 Oct 2022 09:52:14 +0000 (12:52 +0300)]
clients/grpc: Initial start for gRPC proxy

The proxy helper client would bind to the agl-shell protocol interface
but also create a gRPC server which implements the agl-shell protobuf
interface.

The gRPC server implementation created in this helper client would be
used by regular clients if they would require further change the window
management or change window properties.

Note that this is an initial bring-up with some of implementation being
a stub, as  the window properties would actually be implemented when
expanding the agl-shell private extension.

The hooks in the gRPC implementation that are in place are:

- xxx
- yyy
- zzz
- ttt

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

18 months agoagl-shell.xml: Introduce a new interface
Marius Vlad [Sat, 8 Oct 2022 18:06:18 +0000 (21:06 +0300)]
agl-shell.xml: Introduce a new interface

In order to allow another other client bind to agl_shell interface, this
introduces a new specific interface which the client would bind to
first, issue a doas_shell_client request, wait for a response, and
proceeed further if the event received was successful. Afterwards, the
client can bind to agl_shell protocol (and assuming it got 'bound_ok'
event back) can further use the agl_shell protocol as it happens with
the shell client.

This approach avoids adding a new protocol interface and instead re-uses
the same interface, with the note that the shell client is still in
charge of handling background and panels.

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

18 months agoAdd manual activation area configuration option 52/28052/2
Scott Murray [Tue, 11 Oct 2022 20:46:26 +0000 (16:46 -0400)]
Add manual activation area configuration option

Add a per-output "activation-area" configuration option that can be
used to define the activation area for applications that are not
using panels.

Notes:
- A new surface is not created for the given activation area, so
  apps that are not opaque will show the background.  After some
  thought, this seems like acceptable behavior, but it is possible
  that I am missing something.
- At present setting the activation area explicitly disables use of
  any panels, this may not need to be the case and some discussion
  with the AGL community with respect to requirements is likely
  needed.
- It is likely that this feature should be done via a agl-shell
  protocol call instead of via configuration, but doing so will
  require some thought as to the interaction with panels and how
  configuration errors would be communicated back to a client.

Bug-AGL: SPEC-4588

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: I6cdae659f5f7636dc94121a69666b905abda3be3

19 months agocompositor: Use sigaction to trap SIGINT 24/28024/1
Marius Vlad [Wed, 21 Sep 2022 14:29:39 +0000 (17:29 +0300)]
compositor: Use sigaction to trap SIGINT

signalfd interacts badly with gdb's signal trapping - when hitting
ctrl-c in a debugger attached to weston, weston will receive the
signal. This results in weston exiting cleanly when the intent
was to use gdb to interfere with its operation.

Trapping SIGINT was introduced in commit 50dc6989 which ensured we
would call wl_display_terminate() on SIGINT or SIGTERM to clean
up our socket.

Killing weston with SIGINT is quite common for several developers,
so it's important to preserve this clean shutdown behaviour, so
we can't naively stop trapping SIGINT entirely.

Instead, use the sigaction() function to trap SIGINT, and have
the SIGINT handler send weston SIGUSR2 (SIGUSR1 is already
used by xwayland). SIGUSR2 can be trapped in the proper wayland
way via wl_event_loop_add_signal(). This way we can properly
break our event loop and clean up on SIGINT, but we can also
have gdb intercept SIGINT.

There are other ways around this, but I'm hoping this one allows
people to continue using ctrl-c to stop weston, and doesn't
require additional project specific gdb knowledge.

Bug-AGL: SPEC-4570

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I42fc186296856861c8b6aee54a302c7c0574a88d

19 months agocompositor: Add missing SIGCHLD handler 23/28023/1
Marius Vlad [Tue, 20 Sep 2022 11:34:31 +0000 (14:34 +0300)]
compositor: Add missing SIGCHLD handler

We seem to be missing a SIGCHLD signal handlers so this patch
adds one similarity to what weston has.

Bug-AGL: SPEC-4570

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

19 months agocompositor: Stop trapping SIGQUIT 22/28022/1
Marius Vlad [Tue, 20 Sep 2022 08:45:09 +0000 (11:45 +0300)]
compositor: Stop trapping SIGQUIT

We've been trapping SIGQUIT for a "clean shutdown" since commit 3cad436a

However, sources such as:
http://www.gnu.org/software/libc/manual/html_node/Termination-Signals.html

indicate we probably shouldn't be trapping it at all, as the intent of
SIGQUIT is to leave a core file and debug artifacts from the run.

We should perform the minimal amount of clean up to ensure the system isn't
left in an unusable state - but these days that's performed by other
software such as logind.

We can safely stop trapping SIGQUIT entirely.

(Based on work from https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/817)

Bug-AGL: SPEC-4570

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Icf7d4f3e76a58e781bad911a966b65e2798266d0

19 months agoshell: Rewrite client_exec as client_launch 21/28021/1
Marius Vlad [Tue, 20 Sep 2022 07:10:01 +0000 (10:10 +0300)]
shell: Rewrite client_exec as client_launch

This patch is a major rewrite of the client_exec which fixes a couple of
issues found by upstream.

Specifically this address the following two issues:

- Do not weston_log() after fork()
- Own the session for the launched client

These two issues were integrated into this single patch.

It makes use of previously added wrappers to handle custom environment
being passed to the (shell) client being executed.

(Based on the work from https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/954
and from https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/817)

Bug-AGL: SPEC-4509

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

19 months agoprocess-util: Move Xwayland fork helpers to shared 20/28020/1
Marius Vlad [Mon, 19 Sep 2022 19:57:13 +0000 (22:57 +0300)]
process-util: Move Xwayland fork helpers to shared

We'll want to reuse these inside desktop-shell as well as the Weston
frontend.

(Based on the work from
 https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/954)

Bug-AGL: SPEC-4510

Signed-off-by: Daniel Stone <daniel.stone@collabora.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ife13dce545928cf53e4f49a657b756ed88ee742f

19 months agoshared: add str_printf() 26/28026/1
Marius Vlad [Mon, 19 Sep 2022 19:56:43 +0000 (22:56 +0300)]
shared: add str_printf()

asprintf() has the problem that it leaves *strp undefined when it
fails. Here is a simple wrapper that ensures NULL if asprintf() fails,
which is much more convenient to use.

This will be useful in future patches, where one needs to return error
messages from maybe failing functions, and more.

Bug-AGL: SPEC-4510

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I2e689551797da525d110a51b02fd608c9e07c567

19 months agoshared: introduce os_fd_clear_cloexec() 25/28025/1
Marius Vlad [Mon, 19 Sep 2022 19:56:12 +0000 (22:56 +0300)]
shared: introduce os_fd_clear_cloexec()

This function will be used between fork() and exec() to remove the
close-on-exec flag. The first user will be compositor/xwayland.c.

Bug-AGL: SPEC-4510

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ib2245394654651583f9d59785540962ae4cb8a28

19 months agodesktop: Do not attempt to send terminate event 15/28015/1
Marius Vlad [Wed, 21 Sep 2022 16:44:52 +0000 (19:44 +0300)]
desktop: Do not attempt to send terminate event

For cases where the shell client itself is stopped/terminated
or the compositor is taken down, and implicitly with it, the shell
client we won't really have a reasource available.  Use the shell_ready
flag to verify that.

Fixes: 0512e7251611e7040c55

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

19 months agoprotocol/agl-shell.xml: Add an app_state event -- app state notification 67/27967/2
Marius Vlad [Thu, 1 Sep 2022 12:19:59 +0000 (15:19 +0300)]
protocol/agl-shell.xml: Add an app_state event -- app state notification

This protocol bump will notify the client binding to the agl-shell protocol
when a particular application changed its state.

This includes four (4) different events:

- started
- terminated
- activated
- deactivated

This should allow orchestrating start-up with activation as we don't
really know when it would be the proper time to activate an application
when starting up (for the first time). A started event will notify the
shell client we it can do that. These events are not sticky such that
the shell would be responsabile for keep  track of the state, if it
wants to.

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

19 months agolayout: Handle dynamic application/surface movement between outputs 54/27954/3
Marius Vlad [Fri, 26 Aug 2022 19:59:09 +0000 (22:59 +0300)]
layout: Handle dynamic application/surface movement between outputs

This patch takes care of dynamically moving applications from
one output to another, by tracking the output which was used activation
finalisation. It also logs when we detect that we keep having the same
surface active on the output.

Bug-AGL: SPEC-4516
Reported-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ic4ce7d56fa360f2bddc087a1af83fc32728cc95d

19 months agoshell: Remove the black curtain installed on outputs 53/27953/3
Marius Vlad [Thu, 25 Aug 2022 16:04:29 +0000 (19:04 +0300)]
shell: Remove the black curtain installed on outputs

Upon completion of activation we might have an output without
a background surface set-up on that particular output, so this patch
either uses the black curtain as a background surface (useful for
transparent applications, which need it) or we remove it entirely in case
the shell client has one installed.

The patch renames the black_surface to black_curtain to better reflect
its name. Also output filtering would need renaming
(desktop_surface_check_last_surfaces)

Bug-AGL: SPEC-4516
Reported-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I6071b07664772d891a4d8c33a7603573ec2069fa

19 months agolayout: Detect when an application should be migrated to other outputs 52/27952/3
Marius Vlad [Thu, 25 Aug 2022 14:42:34 +0000 (17:42 +0300)]
layout: Detect when an application should be migrated to other outputs

This patch adds a way to determine when to move out/migrate the window to another
output, different than one set previously, or where it was initially added.

This patch only adds support for resizing with a later patch touch the
final activation part.

Uses new output variable to track it the outputs. We send new dimensions
of the output if they do not match the previous/older recorded one.

Bug-AGL: SPEC-4516
Reported-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ic5b6b9c1676543fa5ff1524f58e014ad8abb632b

19 months agodesktop: Avoid sending the dimensions for the first output 05/27905/4
Marius Vlad [Mon, 15 Aug 2022 16:45:53 +0000 (19:45 +0300)]
desktop: Avoid sending the dimensions for the first output

Rather than sending the first available output we have in the system,
use explicitly the output that we specified in the configuration for
that particular appid. If we didn't do that, we would first send the
dimension for the first output, after which we send the dimensions for
the correct output, resulting in a few configure exchanges between the
client and the compositor.

This fixes that by using the correct output from the beginning.

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

19 months agolayout: State explicity the output 04/27904/3
Marius Vlad [Mon, 15 Aug 2022 14:19:56 +0000 (17:19 +0300)]
layout: State explicity the output

No functional changes, just print out in the logs what output is being
explicitly used.

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

19 months agolayout: Use view's mapping once we placed the view in the hidden layer 03/27903/3
Marius Vlad [Mon, 15 Aug 2022 13:01:52 +0000 (16:01 +0300)]
layout: Use view's mapping once we placed the view in the hidden layer

This avoids re-sending the dimensions until the client acks the new
dimensions. It avoids some innocuous logging.

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

19 months agodesktop: Install a black background for REMOTE roles 01/27901/5
Marius Vlad [Fri, 12 Aug 2022 14:38:04 +0000 (17:38 +0300)]
desktop: Install a black background for REMOTE roles

A while back we added the ability to install a black curtain if there no
applications running. This way it provides a visual cue and it signifies
that the applications is no longer running.

While the idea was to install a remote black background for the REMOTE
role, it turns out this would only happened if we were using the Waltham
output type, which is excluding the REMOTE role. Adds an explicit check
for Waltham to still allow for cases where just the REMOTE role is used.

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

19 months agodesktop: Include REMOTE role in initial configuration 00/27900/4
Marius Vlad [Fri, 12 Aug 2022 14:20:01 +0000 (17:20 +0300)]
desktop: Include REMOTE role in initial configuration

The REMOTE role is identical to the DESKTOP one (its merely a tag), so it
should go in the same category.

Fixes 13ac8bab43fffd00.

Bug-AGL: SPEC-4520
Reported-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Iddf7b5ba644cb7317c5f5ac6645c0f149ab1d05d

20 months agoagl-shell: Add bound_ok and bound_fail events and a default destructor 59/27859/4
Marius Vlad [Wed, 3 Aug 2022 13:14:17 +0000 (16:14 +0300)]
agl-shell: Add bound_ok and bound_fail events and a default destructor

As we're increasing the amount of combinations we could have in the AGL
platforms, in which we're mixing various platforms, we require a way
to tell clients that there's already a shell client which in charge.

We can't really have multiple shell clients managing the windows and
surfaces, but in the same time we don't want to sever the wayland
connection the way it happens currently. Racy alternatives might exist,
which  avoid advertising the interface altogether once a
client did bind to the interface but that's not really a
viable solution.

So instead of doing that, this patch introduces two new events which
tells the client that it was either successful, and it can continue
issue requests and receive events or a that it the bind failed. The
client can chose to wait and try later and abandon to bind to the
agl_shell intefface, and behave like a regular client.

While doing an update to protocol to add those two events this patch add
also a default destructor for the protocol.

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

21 months agoFix typo in README 77/27777/1 13.93.0 needlefish/13.93.0 needlefish_13.93.0
chintsung [Mon, 18 Jul 2022 03:38:50 +0000 (11:38 +0800)]
Fix typo in README

- Fix brackets of link

Signed-off-by: chintsung <chichon.tw@gmail.com>
Change-Id: I1f96362bf02919b5bffea9977883f58dd2fa66ac

22 months agolayout: Add a wrapper for adding the view to the hidden layer 84/27684/2
Marius Vlad [Tue, 21 Jun 2022 11:13:56 +0000 (14:13 +0300)]
layout: Add a wrapper for adding the view to the hidden layer

And with it, use it *as well* when detecting a surface shouldn't be
presented if activate-by-default is disabled. The reason for doing that
is to allow application the resize and receive frame events right after
the client shell has been started.

Doing it a later point it time, right when a potential activation could
come from a client, wouldn't really be useful as the client won't react
to configure events. This particular fix is for cases where the
activate by default is disabled and the application itself was added
*before* the client shell sent the ready request.

Bug-AGL: SPEC-4423
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Reported-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com>
Change-Id: I5b08d2ff65fca28126608c2677ec9b558a34caa1

22 months agoshell: Fix a typo when adding surface to pending list 81/27681/1
Marius Vlad [Mon, 20 Jun 2022 13:16:13 +0000 (16:16 +0300)]
shell: Fix a typo when adding surface to pending list

As both names are similar this was probably a typo, and instead of using
the iterator for the list we should use the item itself. This was pretty
hard to track as initially everything was set-up alright.

We were still getting empty lists of pending remote surfaces, when I
observed that we were using the iterator rather than the new item we
just create in that function.

Bug-AGL: SPEC-4445
Reported-by: Scott Murray <scott.murray@konsulko.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I77c4c6721eb4a4e3e8e66faa4fa0584b136d322e

22 months agocompositor: Allow passing continue-without-input 89/27589/2
Marius Vlad [Wed, 1 Jun 2022 09:12:49 +0000 (12:12 +0300)]
compositor: Allow passing continue-without-input

We can specify over cmd line if we don't have any input devices.
Found while investigating xdg-shell and keyboard activation.

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

22 months agoshell: Make sure that app_id is valid before checking it 73/27573/2
Marius Vlad [Mon, 30 May 2022 18:36:30 +0000 (21:36 +0300)]
shell: Make sure that app_id is valid before checking it

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

22 months agolayout: Keep track of popup state to handle activation 72/27572/2
Marius Vlad [Mon, 30 May 2022 17:17:36 +0000 (20:17 +0300)]
layout: Keep track of popup state to handle activation

Upon deactivation explicitly mark the surface as unmapped, and keep
track of the state using the enum already added for that.

Further more, at remap, we need to perform a transform update, so this
adds that as well.

Together with these changes, we now can activate/hide the pop-up window
correctly.

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

22 months agocompositor: Perform activation from keybindings 95/27595/2
Marius Vlad [Wed, 1 Jun 2022 12:48:53 +0000 (15:48 +0300)]
compositor: Perform activation from keybindings

Now that we have common function that peforms surface activation
(xdg-shell and input one) use it for touch and keyboard.

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

22 months agocompositor: Pass flags when adding keybindgs 94/27594/2
Marius Vlad [Wed, 1 Jun 2022 12:18:06 +0000 (15:18 +0300)]
compositor: Pass flags when adding keybindgs

Although we don't really use these flags make it so we
deliever them to libweston.

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

22 months agolayout: Add a way common way activate views 93/27593/2
Marius Vlad [Tue, 31 May 2022 12:40:43 +0000 (15:40 +0300)]
layout: Add a way common way activate views

We install a common function which is being used to de-couple
keyboard presence from input and xdg-shell activation. We also
also use it at surface removal/destruction.

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

22 months agoshell: Extract some common functions 92/27592/2
Marius Vlad [Tue, 31 May 2022 11:44:49 +0000 (14:44 +0300)]
shell: Extract some common functions

For instance this exports retreiving a ivi_seat from weston_seat, and
they are useful in other parts as well.

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

22 months agoinput: Migrate ivi_seat to ivi_compositor header 91/27591/2
Marius Vlad [Sat, 19 Feb 2022 19:52:00 +0000 (21:52 +0200)]
input: Migrate ivi_seat to ivi_compositor header

We might need to retrieve the seat in from different places to make it
available.

Bug-AGL: SPEC-4413

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

22 months agoinput: Remove keyboard listener keyboard focus activation 90/27590/2
Marius Vlad [Sat, 19 Feb 2022 19:45:59 +0000 (21:45 +0200)]
input: Remove keyboard listener keyboard focus activation

This is part of the bigger series to remove the need to have a keyboard
present to activate views/surfaces. This clean-ups any keyboard
listener we had installed previously.

Bug-AGL: SPEC-4413

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

23 months agocompositor: Properly dispose of fullscreen views at shutdown 96/27596/1
Marius Vlad [Fri, 3 Jun 2022 08:56:29 +0000 (11:56 +0300)]
compositor: Properly dispose of fullscreen views at shutdown

While we can have multiple outputs, each with its own fullscreen view,
we have a layer-per-output hence we can't really call layer_fini()
in the output destruction as that what would result in an invalid
link access.

Handle those views destruction and with it, the fullscreen layer fini,
in the finalize bit where all others are handled as well.

This fixes a crash at shutdown, which could be seen when using multiple
outputs, and probably quite problematic when handling a restart.

Fixes: 43bdf9a42bac33df174d6ac7ff1ab2e15441c7b5

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

2 years agoshell: Do not set none role for applications w/o appid 43/27443/1
Marius Vlad [Wed, 4 May 2022 08:12:54 +0000 (11:12 +0300)]
shell: Do not set none role for applications w/o appid

With commit 'layout: Send dimensions when setting up property as
fullscreen' we made so that fullscreen applications will receive the
configure event right from the beginning but that changed a bit the way
we handled applications that do not set-up an appid before doing the
initial wl_surface.commit.

Avoid doing that such that applications do not need to go through a
resize.

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

2 years agoshell: Let the output destroy handler handle layer fini 42/27442/1
Marius Vlad [Wed, 4 May 2022 06:54:20 +0000 (09:54 +0300)]
shell: Let the output destroy handler handle layer fini

This way we don't race with it. Part of 'shell: Added missing layer fini
calls'.

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

2 years agodesktop: Document the repaint schedule 41/27441/1
Marius Vlad [Wed, 4 May 2022 08:21:42 +0000 (11:21 +0300)]
desktop: Document the repaint schedule

Add some further comment why we could still potential need it.

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

2 years agoRevert "desktop: No need to schedule a compositor repaint" 40/27440/1
Marius Vlad [Wed, 4 May 2022 07:27:21 +0000 (10:27 +0300)]
Revert "desktop: No need to schedule a compositor repaint"

This reverts commit 8f85581e96bc71512cbef015ff12dc6441c07d9c.

I incorrectly assumed that we don't need to schedule a repaint, but
applications that do not set-up an appid would still need to go through
a resize and we need to continue to allow doing that.

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

2 years agoshell: Added missing layer fini calls 36/27436/1
Marius Vlad [Tue, 3 May 2022 15:04:14 +0000 (18:04 +0300)]
shell: Added missing layer fini calls

Newer libweston version introduced additional API to determine if we are
missing out proper destruction paths.

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

2 years agocompositor: Proper indentation 35/27435/1
Marius Vlad [Tue, 3 May 2022 09:27:48 +0000 (12:27 +0300)]
compositor: Proper indentation

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

2 years agodesktop: Remove dead code 34/27434/1
Marius Vlad [Tue, 3 May 2022 08:33:10 +0000 (11:33 +0300)]
desktop: Remove dead code

Some dead code artefacts, no need to keep these in.

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

2 years agodesktop: No need to schedule a compositor repaint 33/27433/1
Marius Vlad [Tue, 3 May 2022 08:26:25 +0000 (11:26 +0300)]
desktop: No need to schedule a compositor repaint

Part of a larger clean-up.

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

2 years agomeson.build: Bump up meson version 32/27432/1
Marius Vlad [Tue, 3 May 2022 07:56:24 +0000 (10:56 +0300)]
meson.build: Bump up meson version

Bump meson version requirements to a much newer version + some minor
compiler options which are handled directly by the build system.

yocto seem to use meson 0.63 so we're more than fine bumping the verison
for meson.

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

2 years agolayout: Inform client to resize for fullscreen roles 23/27423/2
Marius Vlad [Mon, 2 May 2022 12:05:23 +0000 (15:05 +0300)]
layout: Inform client to resize for fullscreen roles

In a previous patch we optimized sending the dimensions from the start,
but in some situations the client might set up the surface roles
*after* that happens, which might lead to issue as we are explicitly
terminating the connection if the client wasn't correctly resized by
that time.

This corrects that such that even if we perform a late set-up for the
fullscreen role, we can still tell the client to resize, and later on to
display the surface.

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

2 years agolayout: Send dimensions when setting up property as fullscreen 15/27415/3
Marius Vlad [Wed, 27 Apr 2022 12:44:58 +0000 (15:44 +0300)]
layout: Send dimensions when setting up property as fullscreen

Instead of doing it at commit time, do it right after getting the xdg
toplevel surface such that clients can use it from the beginning.

This now includes fullscreen, besides regular desktop roles, and it
avoid mapping the fullscreen upon commit if the dimensions do not really
match up.

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

2 years agolayout: Do perform a view update transform when unmapped 76/27376/3
Marius Vlad [Wed, 13 Apr 2022 14:27:43 +0000 (17:27 +0300)]
layout: Do perform a view update transform when unmapped

We should always perform a view update transformed when the view is not
mapped -- or better said when mapping the view. Found while
investigating some certain bevahiours related to surfaces not being
activated by default.

While a dirty+surface damage is sufficient when adding views to layers,
on mapping we should also perform an transform update of the view.

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

2 years agolayout: Make the view mapped at activation completion 75/27375/3
Marius Vlad [Wed, 13 Apr 2022 12:37:12 +0000 (15:37 +0300)]
layout: Make the view mapped at activation completion

Instead of tagging it various places just do it a completion phase.
Makes things a bit easier to follow/read.

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

2 years agocompositor: Rename activated_by_default to mapped 74/27374/3
Marius Vlad [Tue, 12 Apr 2022 18:05:06 +0000 (21:05 +0300)]
compositor: Rename activated_by_default to mapped

This variable is about surface being displayed, rather than being
activatred so use mapped to better reflect that.

It also makes things easier to keep track per surface about surfaces
being activated by default or not. No functional change whatsoever.

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

2 years agoWeston 10.0 compatibility changes
Scott Murray [Sat, 5 Feb 2022 22:07:34 +0000 (17:07 -0500)]
Weston 10.0 compatibility changes

Changes:
- Bump libweston dependencies in meson.build.
- Handle addition of another argument to the wet_main and
  weston_compositor_create functions.

Bug-AGL: SPEC-3819

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
2 years agoWeston 9.0 compatibility changes
Scott Murray [Wed, 24 Feb 2021 22:09:40 +0000 (17:09 -0500)]
Weston 9.0 compatibility changes

Changes:
- Bump libweston dependencies in meson.build
- Match weston_compositor_tear_down -> weston_compositor_destroy API
  change by following what was done in weston for 9.0
- Update log context code to match API changes, based on what was
  done in weston for 9.0
- Update transform names to match weston
- Initialize a couple of structure fields to avoid failure from
  -Werror=missing-field-initializers triggered by changes in newer
  wayland.

Bug-AGL: SPEC-3819

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: I48fab590eb59a1b83b0cebc3762ba730450b0e3a

2 years agoRemove the listener in the end of ivi_shell_destroy() 58/27258/2
duerpei [Thu, 17 Mar 2022 05:13:37 +0000 (13:13 +0800)]
Remove the listener in the end of ivi_shell_destroy()

Bug-AGL: SPEC-4291

Signed-off-by: duerpei <duep.fnst@fujitsu.com>
Change-Id: Ieaa78e59365c8749754117cf2587b4c72e1f1f31

2 years agoFix potential memory leak in agl-compositor 27/27227/3
duerpei [Tue, 15 Mar 2022 02:26:03 +0000 (10:26 +0800)]
Fix potential memory leak in agl-compositor

wet_main->parse_options-> .... ->strdup ->malloc
    "config_file" memory is not released
    "log"memory is not released

When agl-compositor startup parameters contain socket and modules,
the memory of socket_name and option_modules also needs to be released.
So these two pointers are also released.

Bug-AGL: SPEC-4270

Signed-off-by: duerpei <duep.fnst@fujitsu.com>
Change-Id: I0d74b92187a0779610f32e75b33ab4fca10329a5

2 years agolayout: Address all other callsites w/ dirty+surface damage 13/27213/2 12.93.0 marlin/12.93.0 marlin_12.93.0
Marius Vlad [Mon, 21 Feb 2022 12:27:28 +0000 (14:27 +0200)]
layout: Address all other callsites w/ dirty+surface damage

This is just a missing left-over 'layout: Inflict damage on all
subsurfaces'. As we have different paths for other types of surface
roles, address them as well.

Bug-AGL: SPEC-4262

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

2 years agolayout: Inflict surface damage 12/27212/2
Marius Vlad [Fri, 18 Feb 2022 11:48:59 +0000 (13:48 +0200)]
layout: Inflict surface damage

Commit 'layout: Remove explicit damage call' re-done the way we've
handled additions to the layer, removing any damage infliction to either
the plane where to view is visible. While marking the view as dirty (and
with it any other children to the that view), we still
to tell the compositor that the view being added, has suffered changes.

Bug-AGL: SPEC-4262

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

2 years agolayout: Remove left-over comment 11/27211/2
Marius Vlad [Fri, 11 Feb 2022 17:42:27 +0000 (19:42 +0200)]
layout: Remove left-over comment

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

2 years agoFix potential memory leak 01/27201/3
duerpei [Wed, 23 Feb 2022 01:36:48 +0000 (09:36 +0800)]
Fix potential memory leak

Bug-AGL:SPEC-4257

Signed-off-by: duerpei <duep.fnst@fujitsu.com>
Change-Id: I0effc97710d9bf93f5044e22400e9ff6699a4309

2 years agomeson.build: Don't set the dependency type for wayland-scanner 02/27102/1 12.92.0 marlin/12.92.0 marlin_12.92.0
Marius Vlad [Fri, 28 Jan 2022 11:08:45 +0000 (13:08 +0200)]
meson.build: Don't set the dependency type for wayland-scanner

meson (0.53) seem to be smart enough to resolve cross-compile
dependencies without setting explicitly the dependency type.

Setting the dependency  as native results in ignoring PKG_CONFIG_PATH
and using PATH to choose and alternative pkg-config. Sourcing the
yocto/OE toolchain would result in picking the hosts pkg-config due to
modified a PATH where SDKTARGETSYSROOT is before any of the hosts paths.

Combined that with the fact that PKG_CONFIG_PATH is reset when the
dependency is se to native (why that hapens is something to further
investigate) results in not finding wayland-scanner.

Tested with both yocto/OE toolchains and native (local) builds to make
sure we can still build it and seems we're fine.

Bug-AGL: SPEC-4169

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

2 years agoFix potential memory leak 93/27093/2
Rongrong Yuan [Thu, 20 Jan 2022 02:19:04 +0000 (10:19 +0800)]
Fix potential memory leak

Bug-AGL: SPEC-4221

Signed-off-by: Rongrong Yuan <yuanrr.fnst@fujitsu.com>
Change-Id: I30634977a3b899647a5f2faad2c70db39e97d09e

2 years agoclient/screenshooter: Compute the width/height for a single output 82/27082/1
Marius Vlad [Thu, 13 Jan 2022 17:29:21 +0000 (19:29 +0200)]
client/screenshooter: Compute the width/height for a single output

We're missing determining the buffers dimenions, so this basically adds
that.  Turns out this was introduced w/ commit 'clients/screenshooter:
Fix taking screenshot on multiple outputs'. Still clueless on how this
worked in CI, unless we're using `-a' to take a screenshot on all
outputs.

Bug-AGL: SPEC-4217

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

2 years agoagl-compositor: Add NULL check after creating surface/view 61/27061/1
AndyZhou [Wed, 22 Dec 2021 10:54:49 +0000 (18:54 +0800)]
agl-compositor: Add NULL check after creating surface/view

Add a check to verify if both the surface/view was created successfully
in function create_black_surface_view of src/shell.c file.

Bug-AGL: SPEC-4193

Signed-off-by: ZhouMingying <zhoumy@cn.fujitsu.com>
Change-Id: I69c6a6023c8b7a3b6e376f3cba25020a851648ab

2 years agoagl-compositor:Add NULL check after zalloc in src directory 01/27001/6 12.91.0 marlin/12.91.0 marlin_12.91.0
AndyZhou [Wed, 22 Dec 2021 08:00:59 +0000 (16:00 +0800)]
agl-compositor:Add NULL check after zalloc in src directory

There's no NULL check in zalloc.
Add a NULL check after zalloc.
And add memory free before return error.

Bug-AGL: SPEC-4178

Signed-off-by: ZhouMingying <zhoumy@cn.fujitsu.com>
Change-Id: Ic0e0e2007b2897a451507aed100ad01b65695383

2 years agoagl-compositor:Add NULL check after zalloc in screenshooter.c 00/27000/2
AndyZhou [Mon, 13 Dec 2021 03:41:25 +0000 (11:41 +0800)]
agl-compositor:Add NULL check after zalloc in screenshooter.c

There's no NULL check in zalloc.
xdg_output is alloced by zalloc.
Add a NULL check after zalloc and before use xdg_output.

Bug-AGL: SPEC-4178

Signed-off-by: ZhouMingying <zhoumy@cn.fujitsu.com>
Change-Id: Idc2e3fd6be823c063a84868ba37b26ffe90db6fc

2 years agoagl-compositor: Correct several spell issues in the protocol xml files 99/26999/3
AndyZhou [Mon, 20 Dec 2021 05:32:05 +0000 (13:32 +0800)]
agl-compositor: Correct several spell issues in the protocol xml files

There are several spell issues in the protocol xml files.
Modify to correct them.

Bug-AGL: SPEC-4174

Signed-off-by: ZhouMingying <zhoumy@cn.fujitsu.com>
Change-Id: I052a1cb4b1a0054305899a1d83e4be0fd9d03c2b

2 years agoagl-compositor: Correct several spell or grammar issues in the README.md file. 33/26933/3
AndyZhou [Mon, 6 Dec 2021 09:47:55 +0000 (17:47 +0800)]
agl-compositor: Correct several spell or grammar issues in the README.md file.

There are several issues in the README.md file.
Modify to correct them.

Bug-AGL: SPEC-4154

Signed-off-by: AndyZhou <zhoumy@cn.fujitsu.com>
Change-Id: I3a26692ba5257f99038262fdd1e45d87dd84da08

2 years agolayout: Remove explicit damage call 07/27007/1
Marius Vlad [Thu, 16 Dec 2021 12:41:08 +0000 (14:41 +0200)]
layout: Remove explicit damage call

As we will be marking all the views dirty, weston_output_repaint()
should pick-up correctly any inflicted damage, and perform an
implicit redraw without the need for an explict to call to
weston_view_below_damage().

Note that we still need to schedule a repaint for that particular view.

While at it, also remove an explicit call to
weston_view_update_transform() which is going to be handled internally
as well, when rebuilding the view list by libweston.

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

2 years agolayout: Inflict damage on all subsurfaces 82/26982/6
Marius Vlad [Wed, 8 Dec 2021 11:18:55 +0000 (13:18 +0200)]
layout: Inflict damage on all subsurfaces

As it has been seen with the camera-gstreamer application, when switching
back and forth between various other application and camera-gstreamer
we'll get artefacts/black surface as a result that we're only adding
damage to the main parent surface.

Bug-AGL: SPEC-4145

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

2 years agomeson.build: Bump compositor version 32/26932/2
Marius Vlad [Tue, 23 Nov 2021 18:50:25 +0000 (20:50 +0200)]
meson.build: Bump compositor version

This bumps the compositor version to accomodate the protocol
update well.

Bug-AGL: SPEC-4133

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

2 years agoshell: Refactor pending surfaces for existing pending ones 31/26931/2
Marius Vlad [Thu, 25 Nov 2021 22:07:09 +0000 (00:07 +0200)]
shell: Refactor pending surfaces for existing pending ones

This patch refactors a bit the way we add pending surface roles, such
that it updates to an existing surface, rather than create a new one
with the same app_id.

Bug-AGL: SPEC-4133

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

2 years agosrc/desktop: Add a compositor destroy listener 30/26930/3
Marius Vlad [Tue, 23 Nov 2021 18:46:37 +0000 (20:46 +0200)]
src/desktop: Add a compositor destroy listener

Tearing down the ivi compositor instance (the shell) requires listening
for such an event and handle any potential destruction of surfaces.
With it we use to destroying any pending surfaces might have been left.

Bug-AGL: SPEC-4133

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

2 years agosrc/shell: Add set_app_property_mode request 29/26929/2
Marius Vlad [Tue, 23 Nov 2021 18:12:02 +0000 (20:12 +0200)]
src/shell: Add set_app_property_mode request

Bug-AGL: SPEC-4133

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

2 years agolayout: Fix-up the positions when placing the pop-up/dialog 36/26836/3
Marius Vlad [Fri, 5 Nov 2021 17:38:21 +0000 (19:38 +0200)]
layout: Fix-up the positions when placing the pop-up/dialog

Turns out we weren't accounting for the initial position (of the output)
as to derive the correct positioning of thew view/surface. This uses the
output x and y value and together with the values supplied by the user
to result in correct placement.

Bug-AGL: SPEC-4127

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

2 years agoshell: Fix passing maximized state from the start 31/26831/2
Marius Vlad [Thu, 4 Nov 2021 15:32:28 +0000 (17:32 +0200)]
shell: Fix passing maximized state from the start

We've added an optimization where we where sending to regular (desktop)
surfaces from the beginning the maximized state, together with the size
whenever the client signaled that it is ready to present.

That optimization failed to take into account other potential roles,
more importanly, the pop-op role which should not be getting any window
state, and implicitly shouldn't be getting any surface dimensions,
leaving it to the client to decide that. Patch checks all pending lists
to make sure we're not skipping any on purpose.

Bug-AGL: SPEC-4119

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

2 years agomeson.build: Add a waltham-transmitter pkg-config pc file 75/26675/1 12.90.1 marlin/12.90.1 marlin_12.90.1
Marius Vlad [Mon, 27 Sep 2021 16:32:30 +0000 (19:32 +0300)]
meson.build: Add a waltham-transmitter pkg-config pc file

It would be of tremendous help to know when the transmitter plugin is
really installed, to avoid assuming that the waltham library is enough.

Bug-AGL: SPEC-4087

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

2 years agomeson.build: Conditionally build with headless support 74/26674/1
Marius Vlad [Mon, 27 Sep 2021 15:23:58 +0000 (18:23 +0300)]
meson.build: Conditionally build with headless support

This allow to build the compositor without headless support, just in
case libweston wasn't built with it.

Bug-AGL: SPEC-4087

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

2 years agomeson.build: Clarify out-of-tree build error 73/26673/1
Marius Vlad [Mon, 27 Sep 2021 15:07:07 +0000 (18:07 +0300)]
meson.build: Clarify out-of-tree build error

And with it remove libweston-X mentioning, as it applies to all
libweston versions.

Bug-AGL: SPEC-4087

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

2 years agoclients/screenshooter: Fix taking screenshot on multiple outputs 15/26615/1
Marius Vlad [Fri, 3 Sep 2021 11:46:53 +0000 (14:46 +0300)]
clients/screenshooter: Fix taking screenshot on multiple outputs

Turns out we were re-initializing the buffers min/max values each time
for each output, thus not computing the entire combined output. This is
a trivial fix.

Bug-AGL: SPEC-4064

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

2 years agocompositor: Do not allow vt-switching by default 75/26575/1
Marius Vlad [Thu, 26 Aug 2021 16:12:29 +0000 (19:12 +0300)]
compositor: Do not allow vt-switching by default

Users are still able to customize that behaviour by modifying
configuration file.

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

2 years agocompositor: Avoid loading systemd-notify plug-in 52/26452/2
Marius Vlad [Thu, 24 Jun 2021 09:04:47 +0000 (11:04 +0200)]
compositor: Avoid loading systemd-notify plug-in

This helps being compliant with the weston ini configuration file, and
in the same time being able to load other necessary modules. Instead of
creating a separate module for loading the systemd-notify do the same
thing as xwayland and avoid any attempt of loading it if passed over the
command line, or specified in the ini file.

Bug-AGL: SPEC-4001

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

2 years agomeson.build: Install run-time shared library to a specific path 53/26453/1
Marius Vlad [Thu, 24 Jun 2021 10:40:52 +0000 (12:40 +0200)]
meson.build: Install run-time shared library to a specific path

Use prefix_path + libdir to install the run-time shared library and
avoid pulling lib with it.

This is necessary to avoid installing under PREFIX/ and use
PREFIX/agl-compositor instead. This was unfortunately missed
when doing the split in a previous commit.

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

3 years agomain: Split of main() from wet_main() 83/26283/1 sandbox/mvlad/pre-ci 11.91.0 11.92.0 12.90.0 lamprey/11.91.0 lamprey/11.92.0 lamprey_11.91.0 lamprey_11.92.0 marlin/12.90.0 marlin_12.90.0
Marius Vlad [Tue, 20 Apr 2021 12:06:15 +0000 (15:06 +0300)]
main: Split of main() from wet_main()

This is follow-up to catch up with weston's way of loading the
compositor instance. This is necessary because the test itself is
capable of loading a specific compositor instance (and with, specific
arguments).

No functional changes whatsoever.

Bug-AGL: SPEC-3889, SPEC-3880

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

3 years agomain: Copy cmd line args and print them 82/26282/1
Marius Vlad [Tue, 20 Apr 2021 11:19:08 +0000 (14:19 +0300)]
main: Copy cmd line args and print them

This makes it really easy to spot on what arguments have been passed to
the compositor. When a test client will run the compositor this will be
helpful to verify that we pass the correct arguments.

Fixes a small typo along the way.

Bug-AGL: SPEC-3880

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

3 years agomain: Teach agl-compositor to load additional modules 81/26281/1
Marius Vlad [Tue, 20 Apr 2021 10:31:18 +0000 (13:31 +0300)]
main: Teach agl-compositor to load additional modules

Passing modules arguments to the compositor instance would be useful
when using the testing framework/harness because that way the test
itself can start-up. The idea here is that we would need to load-up a
testing plug-in (either one from weston) or one written specifically for
this.

Bug-AGL: SPEC-3888

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

3 years agomain: Add support for loading the headless-backend 80/26280/1
Marius Vlad [Tue, 20 Apr 2021 09:40:19 +0000 (12:40 +0300)]
main: Add support for loading the headless-backend

For making use of the testing framework/harness we should be able to
load up the headless backend. This patch adds support for loading it.

Bug-AGL: SPEC-3887

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

3 years agomeson.build: Do an release update before libweston9 integration 48/26248/2
Marius Vlad [Fri, 9 Apr 2021 08:05:23 +0000 (11:05 +0300)]
meson.build: Do an release update before libweston9 integration

We haven't had an release for quite some time now so, do it now before
the libweston9 integration.

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

3 years agolayout: Remove weston_output_damage dependecy 46/26246/4
Marius Vlad [Wed, 7 Apr 2021 15:09:06 +0000 (18:09 +0300)]
layout: Remove weston_output_damage dependecy

Doing a damage_below for the view should be sufficient to trigger a
repaint. This way we don't actually need it.

Bug-AGL: SPEC-3641

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

3 years agolayout: Fix split role sending invalid dimensions 45/26245/1
Marius Vlad [Wed, 7 Apr 2021 19:16:02 +0000 (22:16 +0300)]
layout: Fix split role sending invalid dimensions

As we send from the beginning/start the size for the client, we'll be
missing a checking when using split type of surfaces, which will result
in invalid width/height passed to clients on configure events. Avoid
using it entirely and assume for split roles to use half of the output
by default.

Bug-AGL: SPEC-3881

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

3 years agodesktop: Tell clients to use current geometry area from start 55/26155/1
Marius Vlad [Wed, 10 Mar 2021 22:24:04 +0000 (00:24 +0200)]
desktop: Tell clients to use current geometry area from start

After the shell UI is started we can tell clients the available geometry
area, and with it, they can avoid resizing to the surface size.

Bug-AGL: SPEC-3839

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

3 years agodesktop: Send remove event only if output and app_id is set 54/26154/1
Marius Vlad [Wed, 10 Mar 2021 18:03:07 +0000 (20:03 +0200)]
desktop: Send remove event only if output and app_id is set

This will guard against clients do not have an application id, or they
weren't activated at all.

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

3 years agoNotify about application destruction 54/26054/2
Walter Lozano [Wed, 17 Feb 2021 14:00:44 +0000 (11:00 -0300)]
Notify about application destruction

Currently agl-compositor notifies about application ids which can be
activated/deactivated, as well as the application state. However, when
an application is destroyed this information is not communicated to desktop
making it out of sync with the actual list of available applications.

To overcome this limitation extend the protocol and the logic to notify
about application destruction on surface remove.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Change-Id: Ib766cf3f3fbd10f55b85212480dc4717ab1bec22

3 years agoAllow unregistered applications in rba 92/25992/2
Anusha Gugale [Thu, 4 Feb 2021 07:01:05 +0000 (12:31 +0530)]
Allow unregistered applications in rba

- To allow unregistered applications, set allow_unregistred_app=true
  in .ini file under core section of /etc/xdg/weston/weston.ini .

  Bug-AGL: SPEC-3738

Signed-off-by: Anusha Gugale <external.agogale@jp.adit-jv.com>
Change-Id: Ic56564ea97900df0091d92a2dd4ed1bc7cb0559f

3 years agoUse parameterized constructor of RBAArbitrator 36/25936/3 10.93.0 koi/10.93.0 koi_10.93.0
Anusha Gugale [Thu, 21 Jan 2021 03:38:43 +0000 (09:08 +0530)]
Use parameterized constructor of RBAArbitrator

- To hide unnecessary internal interfaces from user, reconstructed
  public files of librba. At this time, default constructor has been removed.

  Bug-AGL: SPEC-3738

Signed-off-by: Anusha Gugale <external.agogale@jp.adit-jv.com>
Change-Id: I957796861081c79df9018cac92bd06927952924d

3 years agodoc/arch_diagram: Update architecture diagram with a small legend 02/25902/1
Marius Vlad [Wed, 13 Jan 2021 13:20:39 +0000 (15:20 +0200)]
doc/arch_diagram: Update architecture diagram with a small legend

Trivial change to display which are API calls, which are Wayland ones.

Bug-AGL: SPEC-3386

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

3 years agoAdded rba policy implementation 23/25823/8 10.92.0 koi/10.92.0 koi_10.92.0
Anusha Gugale [Thu, 17 Dec 2020 09:38:36 +0000 (15:08 +0530)]
Added rba policy implementation

- Added rba-policy option in meson file
- Created new rba adapter file to call rba interfaces from librba
- All the application from Homescreen will be allowed to
  display through rba policy as its added in RBAModel.json

  Bug-AGL: SPEC-3738

Signed-off-by: Anusha Gugale <external.agogale@jp.adit-jv.com>
Change-Id: Iffd4ac16d9abe768476d025556cbe98a31553288

3 years agomeson.build: Fix building with cross SDK 68/25868/1
Marius Vlad [Wed, 6 Jan 2021 17:14:12 +0000 (19:14 +0200)]
meson.build: Fix building with cross SDK

For some time now, yocto/OE no longer builds all weston back-ends, which
means the X11 is no longer supported on AGL platform.

The agl-compositor can be built, assuming all dependencies have been
satisfied, without the need of having an AGL or yocto/OE environment,
but so far, I've never tried using SDK directly.

This patch should allow building the compositor, by only using the AGL
SDK, and instead of using the local pkg-config, only use what is
available in the SDK sysroot. This takes care of assuming that X11
back-end is available, when in reality, in the AGL SDK platform that is
not the case.

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

3 years agomain: Add activate_by_default ini option 67/25867/1
Marius Vlad [Wed, 6 Jan 2021 16:24:01 +0000 (18:24 +0200)]
main: Add activate_by_default ini option

Displaying the application surface as soon as started required
activating the surface by default. With this patch, we give the
possibility to do it conditionally, as it helps CI with cases where we
don't really want other applications change the active surface.

With applications that start by default, this interferes with the
ability to take a screenshot with just the background.

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

3 years agolayout: Do not attempt to activate surfaces that doesn't have a valid app_id 85/25585/3 10.91.0 koi/10.91.0 koi_10.91.0
Marius Vlad [Wed, 18 Nov 2020 13:54:39 +0000 (15:54 +0200)]
layout: Do not attempt to activate surfaces that doesn't have a valid app_id

Observed when trying to activate (a previous one, as a result
of deactivation) a surface that didn't had an application id set.

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

3 years agoshell: Throttle the log message 84/25584/2
Marius Vlad [Wed, 18 Nov 2020 13:06:29 +0000 (15:06 +0200)]
shell: Throttle the log message

As libweston doesn't currently have a rate limiting the log message
function, use a static variable to limit the amount of log message we
might be seeing if application do not set-up an app_id.

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