src/agl-compositor.git
23 months agolayout: Address all other callsites w/ dirty+surface damage 30/27530/1 lamprey 12.1.10 12.1.11 12.1.12 12.1.13 12.1.14 12.1.15 12.1.16 12.1.17 12.1.18 12.1.19 12.1.4 12.1.5 12.1.6 12.1.7 12.1.8 12.1.9 lamprey/12.1.10 lamprey/12.1.11 lamprey/12.1.12 lamprey/12.1.13 lamprey/12.1.14 lamprey/12.1.15 lamprey/12.1.16 lamprey/12.1.17 lamprey/12.1.18 lamprey/12.1.19 lamprey/12.1.4 lamprey/12.1.5 lamprey/12.1.6 lamprey/12.1.7 lamprey/12.1.8 lamprey/12.1.9 lamprey_12.1.10 lamprey_12.1.11 lamprey_12.1.12 lamprey_12.1.13 lamprey_12.1.14 lamprey_12.1.15 lamprey_12.1.16 lamprey_12.1.17 lamprey_12.1.18 lamprey_12.1.19 lamprey_12.1.4 lamprey_12.1.5 lamprey_12.1.6 lamprey_12.1.7 lamprey_12.1.8 lamprey_12.1.9
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
(cherry picked from commit cec4cf8fe409cae5618e81e4a3b6dd11cc8b2aa9)

23 months agolayout: Inflict surface damage 29/27529/1
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
(cherry picked from commit 62e020b90b0627e7f24428d5db7b6790b3a161b0)

23 months agolayout: Remove left-over comment 28/27528/1
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
(cherry picked from commit b06ffcc3ca1ed5d6d9e776dcdc15949793d97c43)

2 years agolayout: Remove explicit damage call 17/27017/1 12.1.1 12.1.2 12.1.3 lamprey/12.1.1 lamprey/12.1.2 lamprey/12.1.3 lamprey_12.1.1 lamprey_12.1.2 lamprey_12.1.3
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 83/26983/2
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 agolayout: Fix-up the positions when placing the pop-up/dialog 65/26865/1 12.1.0 lamprey/12.1.0 lamprey_12.1.0
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 64/26864/1
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 agocompositor: Avoid loading systemd-notify plug-in 10/26610/1 12.0.1 lamprey/12.0.1 lamprey_12.0.1
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 08/26608/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

2 years agocompositor: Do not allow vt-switching by default 86/26586/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 agoAdd gitreview file for Lucky Lamprey branch 11.93.0 12.0.0 lamprey/11.93.0 lamprey/12.0.0 lamprey_11.93.0 lamprey_12.0.0
Jan-Simon Möller [Wed, 30 Jun 2021 21:04:36 +0000 (23:04 +0200)]
Add gitreview file for Lucky Lamprey branch

Update the .gitreview file.

Bug-AGL: SPEC-4006
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
Change-Id: I87030a715f3b89113d60d7b7ee6853233a079a9e

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

3 years agobuild/: Allow to build the compositor w/o waltham 83/25583/2
Marius Vlad [Wed, 18 Nov 2020 12:36:23 +0000 (14:36 +0200)]
build/: Allow to build the compositor w/o waltham

Provides empty implementations to avoid sprinking ifdefs everywhere. The
transmitter plug-in does not expose a pkgconfig file we instead resort
to test again waltham protocol (which is used by the transmitter) and
the the remoting plug-in.

Fixes a minor deps check in the meson file.

Bug-AGL: SPEC-3691

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

3 years agoshell: Perform wl_list_init() after wl_list_remove() 76/25576/2
Walter Lozano [Sun, 15 Nov 2020 19:52:12 +0000 (19:52 +0000)]
shell: Perform wl_list_init() after wl_list_remove()

In order to follow the best practices perform wl_list_init() after
wl_list_remove() on shell_ready.

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

3 years agodesktop: Allow to remove surface from pending list 57/25557/4
Walter Lozano [Fri, 13 Nov 2020 14:46:08 +0000 (14:46 +0000)]
desktop: Allow to remove surface from pending list

In some special corner cases a surface can be removed while it is
still in the pending list. An example of this case is when a surface
is added and removed before the system is ready. Under this circumstances
the surface still has role == ROLE_NONE and is in the pending list.

The fact of not removing the surface from the pending_list ends in a
segfault when the system is ready.

In order to fix the issue, remove the restriction to only remove surfaces
with role != ROLE_NONE.

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

3 years agodesktop: Do not attempt to advertise the clients if there are none 56/25556/2
Marius Vlad [Thu, 12 Nov 2020 21:31:24 +0000 (23:31 +0200)]
desktop: Do not attempt to advertise the clients if there are none

Clients not binding to agl_shell_desktop will cause spurious signal
emits when they commit the changes. Make sure we only attempt to
advertise if the are clients.

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

3 years agodesktop: Delay surface creation until committed 86/25486/3
Walter Lozano [Mon, 26 Oct 2020 18:08:09 +0000 (18:08 +0000)]
desktop: Delay surface creation until committed

Some frameworks like GTK-3 delay the set_app_id until title and
parent are set, which makes ivi_check_pending_desktop_surface
unable to set the proper role on surface_added. A consequence
of this behaviour is that is not possible to use set_app_property
to configure an application as popup.

Instead, delay the creation of the surface until committed to give
the chance to have a valid app_id configured.

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

3 years agoshell: Destroy weston_transmitter_surface as well 80/25480/3
Marius Vlad [Wed, 21 Oct 2020 21:07:53 +0000 (00:07 +0300)]
shell: Destroy weston_transmitter_surface as well

Instruct waltham-transmitter-plugin that it can destroy its own
surface representation when the weston_surface is also destroyed.

Bug-AGL: SPEC-3601, SPEC-3611

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

3 years agoshell: Keep a reference to weston_transmitter_surface 79/25479/2
Marius Vlad [Wed, 21 Oct 2020 20:31:16 +0000 (23:31 +0300)]
shell: Keep a reference to weston_transmitter_surface

When 'pushing' the surface store a reference of the
weston_transmitter_surface so we can later inform the plug-in when the
weston_surface is destroyed, so that it can also destroy the
transmittter_surface from its side.

Bug-AGL: SPEC-3601, SPEC-3611

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

3 years agodesktop: Insert a black surface only when the output is a remote type 78/25478/2
Marius Vlad [Wed, 21 Oct 2020 18:51:09 +0000 (21:51 +0300)]
desktop: Insert a black surface only when the output is a remote type

And the output is not a waltham version.

Bug-AGL: SPEC-3601, SPEC-3611

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

3 years agodesktop: Group tests for checking against last remote surface 77/25477/2
Marius Vlad [Wed, 21 Oct 2020 17:06:49 +0000 (20:06 +0300)]
desktop: Group tests for checking against last remote surface

Synthetic change, to group them together. Makes reading the code a bit
more clearer.

Bug-AGL: SPEC-3601

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

3 years agoshell: Push the surface to the remote side 38/25438/3
Marius Vlad [Wed, 14 Oct 2020 12:18:08 +0000 (15:18 +0300)]
shell: Push the surface to the remote side

The receiver expects that the sender/transmitter will inform it when it
can create a surface and it can start the gstreamer pipeline.

The transmitter plug-in exposes a way to call that using 'push_surface'
callback. So, whenever we detect that the remote surface is to be
assigned to a waltham-type of output, we would need to call into this
'push_surface' callback. This acts as notification mechanism for the
remote side.

Bug-AGL: 3611

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

3 years agomain: Create a remoting output if the waltham plug-in has been loaded 37/25437/3
Marius Vlad [Wed, 14 Oct 2020 10:58:57 +0000 (13:58 +0300)]
main: Create a remoting output if the waltham plug-in has been loaded

The waltham-transmitter will no longer create an output on its own so
we'll re-use the remoting plug-in for streaming out the buffers to the
remoting side.

Bug-AGL: 3601

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

3 years agoivi-compositor: Add the ability to distinguish between different 36/25436/3
Marius Vlad [Wed, 14 Oct 2020 10:21:16 +0000 (13:21 +0300)]
ivi-compositor: Add the ability to distinguish between different
types of remoting outputs

This is required to further differentiate between remoting outputs as for
waltham we would need to use the transmitter_api to forward a surface
to the remoting output.

Bug-AGL: 3611

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

3 years agomain: Add support loading waltham transmitter plug-in 35/25435/3
Marius Vlad [Fri, 2 Oct 2020 18:28:51 +0000 (21:28 +0300)]
main: Add support loading waltham transmitter plug-in

This is the same as the remoting plug-in, given that we'll be using the
remoting plug-in to create the remoting output.

The difference would be that instead of the 'remoting-output' section
we'll use 'transmitter-output', with all other section specific being
the same. For instance, using agl-shell-app-id we can instruct the
application to be assigned to that 'transmitter-output'.

Bug-AGL: SPEC-3611

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

3 years agolayout: Check app_id for remote type of surfaces 34/25434/3
Marius Vlad [Tue, 6 Oct 2020 06:54:45 +0000 (09:54 +0300)]
layout: Check app_id for remote type of surfaces

We don't have any checks against for not having an app_id being set.

Bug-AGL: SPEC-3601

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

3 years agoshell: Avoid creating and inserting black surface 33/25433/3
Marius Vlad [Tue, 6 Oct 2020 06:51:42 +0000 (09:51 +0300)]
shell: Avoid creating and inserting black surface

Creating and inserting the black surface will require to have an
valid weston output. That might not be always the case so guard
against no output being set.

Bug-AGL: SPEC-3601

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

3 years agomain: Use the output handler to destroy to black view 91/25491/1
Marius Vlad [Thu, 29 Oct 2020 20:59:02 +0000 (22:59 +0200)]
main: Use the output handler to destroy to black view

Use the specific output destroyer handler, instead of destroying it in
the handler itself. This way we can still clean-up and avoid any leaks,
and still not trip ourselves causing a use-after-free, when the output
is destroyed by libweston.

Bug-AGL: SPEC-3630, SPEC-3672

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Reported-by: Walter Lozano <walter.lozano@collabora.com>
Change-Id: I11916245b85d2541286ee438284601b466dc20c2

3 years agoshell: Advertise app when app_id is available 08/25408/3
Walter Lozano [Wed, 23 Sep 2020 13:31:23 +0000 (13:31 +0000)]
shell: Advertise app when app_id is available

When using GTK-3 to create apps, the framework issues set_parent_id
which forces a surface to be added even before the app_id is set.
This causes the compositor to fail to advertise the app.

This patch tries to overcome this issue by checking on surface commit
if the surface was previously advertised, and do it if it was not.

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

3 years agoshell: Avoid advertising applications without app_id set 56/25356/3
Walter Lozano [Thu, 8 Oct 2020 17:07:55 +0000 (14:07 -0300)]
shell: Avoid advertising applications without app_id set

When using GTK-3 to create apps, the framework issues set_parent_id
which forces a surface to be added even before the app_id is set.
This causes the compositor to try to advertise an invalid app_id.

This patch avoids advertising an app which has no app_id set.

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

3 years agomain: Create black surface after listening socket 04/25404/2
Walter Lozano [Thu, 8 Oct 2020 02:19:45 +0000 (02:19 +0000)]
main: Create black surface after listening socket

If agl-compositor is started without XDG_RUNTIME_DIR defined, an error
arises and the system tries to exit cleanly. However, in this process a
segfault is produced and the terminal is left misconfigured.

The cause of this segfault is related to the destruction of the black
surface, which is not handled properly in this corner case.

In order to avoid this issue and as an initial fix, create the surface
after the listening socket, which causes that the check for the var
XDG_RUNTIME_DIR to be done before the surface creation.

Bug-AGL: SPEC-3623

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

3 years agomain: Use a configuration option for hidding out the cursor 04/25304/3
Marius Vlad [Fri, 18 Sep 2020 19:21:16 +0000 (22:21 +0300)]
main: Use a configuration option for hidding out the cursor

Bug-AGL: SPEC-3580

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

3 years agomain: Enable screenshoter interface when debug option is passed 03/25303/3
Marius Vlad [Fri, 18 Sep 2020 17:38:07 +0000 (20:38 +0300)]
main: Enable screenshoter interface when debug option is passed

Bug-AGL: SPEC-3580

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

3 years agoinput: Add basic seat handling 02/25302/3
Marius Vlad [Wed, 16 Sep 2020 21:24:31 +0000 (00:24 +0300)]
input: Add basic seat handling

This allows for basic input handling, to better customize how we handle
out seat capabilities to the client. One useful outcome of this is the
fact that we re-advertise to the client that in some situations there
might not be a pointer available. That should let the client know as to
avoid creating a pointer surface.

Bug-AGL: SPEC-3591

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

3 years agoclient/screenshooter: Client for taking screenshots 01/25301/3
Marius Vlad [Wed, 16 Sep 2020 14:22:24 +0000 (17:22 +0300)]
client/screenshooter: Client for taking screenshots

The client allows to take screenshots of all outputs, a specific output
(making use of xdg_output_manager interface) or just listing outputs.

Bug-AGL: SPEC-3580

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

3 years agoscreenshooter: Add agl-screenshooter protocol 00/25300/2
Marius Vlad [Tue, 15 Sep 2020 15:12:24 +0000 (18:12 +0300)]
screenshooter: Add agl-screenshooter protocol

Just like weston, we add a private protocol. Underneath we make use of
the weston renderer to get a hold of the pixels and transfer them to a
user-supplied buffer. This only brings up the server side implementation
of the protocol.

Bug-AGL: SPEC-3580

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

3 years agolayout: Set active output NULL when displaying background 55/25355/1
Walter Lozano [Wed, 23 Sep 2020 12:41:49 +0000 (12:41 +0000)]
layout: Set active output NULL when displaying background

Currently agl-compositor keeps track of the active app and uses this
information to to also keep track of the previous one. This is useful
to allow to show the previous activated app when deactivating the
current one.

However, when deactivating all the apps, for instance the background,
this information is not saved, which causes that when activating and
deactivating and new app, instead of the background a different app
shows.

This patch sets  output->previous_active = NULL when displaying the
background to overcome this issue.

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

3 years agolayout: Activate by default xdg surface that do not have an app_id set 33/25233/1 9.99.4 jellyfish/9.99.4 jellyfish_9.99.4
Marius Vlad [Wed, 9 Sep 2020 16:48:47 +0000 (19:48 +0300)]
layout: Activate by default xdg surface that do not have an app_id set

The following is necessary in case the app_id is set-up at a later point
in time, and it is intended as a work-around for WAM/chromium68 clients
that specify the app_id after the initial surface commit. Note that
activation will not work, in case the application will never set-up an
app_id because we can't identify which app_id to switch to.

The activation phase is needed to inform the client of the window
dimensions, and it is mandated by the XDG-shell protocol.

Bug-AGL: SPEC-3544

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

3 years agolayout: If no valid output found, abort early with a protocol violation 32/25232/1
Marius Vlad [Wed, 9 Sep 2020 15:00:22 +0000 (18:00 +0300)]
layout: If no valid output found, abort early with a protocol violation

Spotted by code inspection, but haven't seen in the wild.

Bug-AGL: SPEC-3544

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

3 years agolayout: Add missing hooks for other surface roles 00/25000/3 9.99.3 jellyfish/9.99.3 jellyfish_9.99.3
Marius Vlad [Fri, 10 Jul 2020 12:01:28 +0000 (15:01 +0300)]
layout: Add missing hooks for other surface roles

We are missing the activate_by_default hooks for split, pop-up and and
fullscreen roles. Part of that is due to the fact that these roles are
handled a bit differently that the remote and desktop roles.

Note, these hooks are different than the commit ones -- which are
'installed' a bit earlier. This means that there was still a possiblity
one might've used that hook to retrieve the surface role for instance,
and act accordingly.

Also, note that we allow for pop-up/dialogs be activated by using the
deliberate 'activate' request, which allows one to customize the policy
to deny certain pop-up/dialogs to be activated by default, but allow do
so explictly when using the 'activate' request.

Bug-AGL: SPEC-3494

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

3 years agolayout: Advertise state change for other types of surface roles 99/24999/3
Marius Vlad [Sun, 12 Jul 2020 16:34:00 +0000 (19:34 +0300)]
layout: Advertise state change for other types of surface roles

Given that now other surfaces roles will be active by default, we need
to let other application aware of that fact by advertising state change.

Print some debug message while at it, to make it more consistent with
the desktop role.

Bug-AGL: SPEC-3494

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

3 years agoshell: Assume consistency with the desktop roles 98/24998/3
Marius Vlad [Sun, 12 Jul 2020 16:26:22 +0000 (19:26 +0300)]
shell: Assume consistency with the desktop roles

While looking into activation by default of other surfaces, noticed that
we're missing consistency on how we handle other types of surface roles.

This patch, activate all other surfaces by default when starting up,
even if they are started before or after the client shell.
Expecting and assuming the same behaviour is important into trying
to establish some common work-flow for applications.

Bug-AGL: SPEC-3494

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

3 years agopolicy-*: Remove any private binding restrictions for allow-all policy 67/24967/4 9.99.2 jellyfish/9.99.2 jellyfish_9.99.2
Marius Vlad [Fri, 10 Jul 2020 12:56:21 +0000 (15:56 +0300)]
policy-*: Remove any private binding restrictions for allow-all policy

As we don't have any proper mechanisms in place to perform some
level of authentication on the clients binding to the private extensions,
we will resort to allow that to happen, under the default, allow-all policy.

In the same time we add some helpers for checking which applications can
bind to the private extensions but this is for the deny-all policy.
This also includes cluster-receiver and cluster-dashboard application to
that array, as without it the cluster-demo will not all work when using
the deny-all policy.

Bug-AGL: SPEC-3382

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

3 years agodesktop: Fix destruction of applications that fallback to the desktop role 03/24903/2
Marius Vlad [Fri, 26 Jun 2020 13:04:38 +0000 (16:04 +0300)]
desktop: Fix destruction of applications that fallback to the desktop role

With commit 9827cfd25578, application not having a valid app_id will
fallback to being assigned the desktop role. In this case, destroying
those kind of surfaces will not have an output assigned, so add a
code path for those as well. Found while testing cluster-receiver with
waylandsink and sub-surfaces.

Bug-AGL: SPEC-3382

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

3 years agoshell: Avoid checking against surfaces that do not have an app_id 02/24902/1
Marius Vlad [Fri, 26 Jun 2020 12:58:54 +0000 (15:58 +0300)]
shell: Avoid checking against surfaces that do not have an app_id

Not all application will set-up an app_id and we might end up
checking against those. So avoid doing that because str* kind of like
functions do not like that. Discovered when playing with cluster
receiver and sub-surfaces.

Bug-AGL: SPEC-3382

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

3 years agoREADME: Add a few words about the deny-all policy engine 51/24751/5 9.99.1 jellyfish/9.99.1 jellyfish_9.99.1
Marius Vlad [Thu, 11 Jun 2020 09:14:02 +0000 (12:14 +0300)]
README: Add a few words about the deny-all policy engine

Replaces the agl-shell-desktop mention that all clients can bind to the
interface with a mention that that happens only if the policy engine
allows.

Bug-AGL: SPEC-3413

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

3 years agodesktop: Allow desktop_api to handle surface removal 50/24750/5
Marius Vlad [Wed, 10 Jun 2020 17:05:06 +0000 (20:05 +0300)]
desktop: Allow desktop_api to handle surface removal

This patch fixes the situation where the application wasnt't allowed
to create an (ivi) surface, leading to an illegal access of the surface
by the destroyer desktop_api callback.

In case we deny the applications to create the (ivi) surface we let the
desktop_api handle the removal of the surface. A surface without a
role won't have an output set so we use that to determine if we can
remove the link for it. We also avoid dealing with the surface
destruction in the desktop api itself rather than handling it on the
error path of the hook itself.

Bug-AGL: SPEC-3413

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

3 years agopolicy: Add a deny-all policy as an example 49/24749/5
Marius Vlad [Wed, 10 Jun 2020 13:23:14 +0000 (16:23 +0300)]
policy: Add a deny-all policy as an example

Note this will deny any binding to the private extensions by default,
if the compositor is not built with SMACK support.

Defines a potential lists of applications permitted to
create/display/activate surfaces/applications.

Bug-AGL: SPEC-3413

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

3 years agopolicy-default: Use libsmack to check client label 48/24748/5
Marius Vlad [Wed, 10 Jun 2020 10:50:55 +0000 (13:50 +0300)]
policy-default: Use libsmack to check client label

Use the client file descriptor to find out the SMACK label of that
client.  Enforces homescreen to bind to agl_shell and launcher and
alexa-viewer to bind to the agl-shell-desktop interface. Allows access
to agl_shell_desktop to tbtnavi and hvac as those contain example code
on use it for moving it to other outputs.

Bug-AGL: SPEC-3396

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

3 years agopolicy: Add a new policy hook to restrict access to private extensions 47/24747/5
Marius Vlad [Tue, 9 Jun 2020 10:18:11 +0000 (13:18 +0300)]
policy: Add a new policy hook to restrict access to private extensions

In this manner we can control which clients can bind to which interface
(either the agl_shell one or the agl_shell_desktop one).

Bug-AGL: SPEC-3394

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

3 years agodesktop: Avoid referencing the output's surface for pending surfaces 33/24833/1
Marius Vlad [Wed, 24 Jun 2020 13:01:36 +0000 (16:01 +0300)]
desktop: Avoid referencing the output's surface for pending surfaces

Pending surfaces will only get a valid role when the client shell sends
out ready() request to start presenting. Corner-case would be that
pending surface is destroyed, moment in which we realise we never set-up
an output. This is corner-case and treat as is.

Bug-AGL: SPEC-3448

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

3 years agodoc: Added arch diagram 71/24771/2
Marius Vlad [Sun, 14 Jun 2020 16:31:04 +0000 (19:31 +0300)]
doc: Added arch diagram

Bug-AGL: SPEC-3386

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

3 years agoREADME: move README.md to doc/ 70/24770/1
Marius Vlad [Fri, 12 Jun 2020 18:00:41 +0000 (21:00 +0300)]
README: move README.md to doc/

Bug-AGL: SPEC-3386

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

3 years agolayout: Clip the view to the size specified by width and height 56/24756/4
Marius Vlad [Thu, 11 Jun 2020 15:07:42 +0000 (18:07 +0300)]
layout: Clip the view to the size specified by width and height

This uses the bx and by as origin for the bounding box if those were
passed on. The compositor will set up a mask clip for the window if the
both width and height are positive.

This also removes the geometry of the surface and passes the x and y values
directly.

Bug-AGL: SPEC-3419

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

3 years agoshell: Pass the bounding box values to the pop-up surface 55/24755/4
Marius Vlad [Thu, 11 Jun 2020 13:21:37 +0000 (16:21 +0300)]
shell: Pass the bounding box values to the pop-up surface

Necessary in order to make use options passed in with the protocol.

Bug-AGL: SPEC-3419

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

3 years agoagl-shell-desktop: Add the ability to pass width and height as 54/24754/3
Marius Vlad [Thu, 11 Jun 2020 13:08:42 +0000 (16:08 +0300)]
agl-shell-desktop: Add the ability to pass width and height as
area of the bounding box

The width and height will represent a rectangle which can be used to
define the maxium area to have the surface in. Any part of the surface
area that exceeds the area delimited by this bounding box will be
clipped away. The initial position of the bounding box is specified
using the bx and by values.

Bug-AGL: SPEC-3419

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

3 years agoshell: Advertise application_id event for other surface roles 52/24652/2
Marius Vlad [Mon, 8 Jun 2020 18:11:12 +0000 (21:11 +0300)]
shell: Advertise application_id event for other surface roles

application_id event is sent just when a client binds to the
agl_desktop_shell interface and when new desktop role surface were
created, skipping split, fullscreen and pop-up kind of surface. This
patch sends the application_id event for those as well.

Makes SPEC-3412 much easier to determine when the application itself was
started.

Bug-AGL: SPEC-3412

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

3 years agolayout: Do not attempt to activate the surface on the remote output 51/24651/2
Marius Vlad [Fri, 5 Jun 2020 14:23:43 +0000 (17:23 +0300)]
layout: Do not attempt to activate the surface on the remote output

Once the view has been placed on remote output do not attempt to
activate it on other output, as it would make quite confusing to have
same view on multiple outputs.

Bug-AGL: SPEC-3280

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

3 years agosrc: Mark surfaces with the 'remote' role if configuration file says so 50/24650/2
Marius Vlad [Fri, 5 Jun 2020 14:16:30 +0000 (17:16 +0300)]
src: Mark surfaces with the 'remote' role if configuration file says so

As we don't have an explicit way to do it, like we have with the
protocol, we try to determine if the surface was being assigned a remote
output and use that, when the surface is created.

Bug-AGL: SPEC-3280

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

3 years agomain: Do the installment of black surfaces for remote outputs as well 49/24649/2
Marius Vlad [Fri, 5 Jun 2020 12:30:35 +0000 (15:30 +0300)]
main: Do the installment of black surfaces for remote outputs as well

The change to enable the remote outputs later than local ones, means
we need to make sure we still have a black surface installed for the
remoting output.

Bug-AGL: SPEC-3280

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

3 years agoshell: Add some extra checks to make sure we don't trip ourselves 48/24648/2
Marius Vlad [Fri, 5 Jun 2020 12:27:31 +0000 (15:27 +0300)]
shell: Add some extra checks to make sure we don't trip ourselves

Dynamically removing and inserting surfaces on outputs requires making
sure the surface is still mapped on that output.

Bug-AGL: SPEC-3280

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

3 years agomain: Enable remote outputs later than local (DRM) outputs 47/24647/2
Marius Vlad [Fri, 5 Jun 2020 11:00:30 +0000 (14:00 +0300)]
main: Enable remote outputs later than local (DRM) outputs

Will allow the client shell to receive, and to use as primary output,
the local outputs first, without the need to (pre-)configure the
client shell or the launcher. Makes integration much easier and will
retain the same functionality we had with weston.

Bug-AGL: SPEC-3280

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

3 years agomain, layout: Minor clean-ups and added some further logging 46/24646/2
Marius Vlad [Wed, 3 Jun 2020 14:52:07 +0000 (17:52 +0300)]
main, layout: Minor clean-ups and added some further logging

Identifies the output being used, and removes the need to have the macro
set. At the moment purely informative, but might be needed in case of
debugging.

Bug-AGL: SPEC-3280

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

3 years agomain: Retrieve the agl-shell-app-id from the config file 67/24667/3
Marius Vlad [Tue, 2 Jun 2020 15:17:30 +0000 (18:17 +0300)]
main: Retrieve the agl-shell-app-id from the config file

Just like local outputs, use the agl-shell-app-id specified in the
'remote-output' section to assign that output to the specific
application id.

Bug-AGL: SPEC-3280

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

3 years agomain: Retrieve the transform and scale from config file 66/24666/3
Marius Vlad [Tue, 2 Jun 2020 15:12:39 +0000 (18:12 +0300)]
main: Retrieve the transform and scale from config file

We were missing retrieving the scale and transform for the
remote-output.

Bug-AGL: SPEC-3280

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

3 years agosrc: Create an ivi_output for the remote output 65/24665/3
Marius Vlad [Tue, 2 Jun 2020 14:33:39 +0000 (17:33 +0300)]
src: Create an ivi_output for the remote output

Ensures that we can retrieve the ivi_output from a weston_output using
its destroy listener. Necessary for setting and retrieving the wl_output
when activating/moving surfaces to that 'remote' output.

Bug-AGl: SPEC-3280

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

3 years agosrc: Hold a reference for remoting_api in the ivi_compositor 64/24664/3
Marius Vlad [Tue, 2 Jun 2020 13:37:25 +0000 (16:37 +0300)]
src: Hold a reference for remoting_api in the ivi_compositor

This will be necesary a bit in the future, to ensure that we can't
later on enable the remote output so we need access to the api.

Bug-AGl: SPEC-3280

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

3 years agomain: Add the ability to load the remote plugin 63/24663/4
Marius Vlad [Tue, 2 Jun 2020 09:47:13 +0000 (12:47 +0300)]
main: Add the ability to load the remote plugin

Streaming to 'remote' outputs needs the remote-plugin library.
We build it automatically if we determine that the gst dependencies are
satisfied, otherwise we're using a stub version for it.

Unfortunatelly, upstream doesn't provide necessary header for the
remoting.h so we copy-paste directly. Will follow up with upstream
to provide headers for the plugins.

Bug-AGl: SPEC-3280

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

3 years agodesktop: Remove commiting code for the panel 62/24662/3
Marius Vlad [Mon, 1 Jun 2020 17:17:23 +0000 (20:17 +0300)]
desktop: Remove commiting code for the panel

We no longer use older qtwayland version so there's no need to
keep in place anymore.

Bug-AGl: SPEC-3280

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

3 years agoshell: Do not remove the black surface if we don't have a background 61/24661/3
Marius Vlad [Mon, 1 Jun 2020 17:12:07 +0000 (20:12 +0300)]
shell: Do not remove the black surface if we don't have a background
set for that output

Bug-AGL: SPEC-3280

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

3 years agodesktop: Display a black surface for apps being moved using config file 60/24660/3
Marius Vlad [Mon, 1 Jun 2020 18:46:32 +0000 (21:46 +0300)]
desktop: Display a black surface for apps being moved using config file

Just like the 'remote' surface roles, put back a black surface if
there's no background set and if it is the last surface on that output.

Bug-AGL: SPEC-3280

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

3 years agolayout: Remove black surface when trying to use migrate views to other 59/24659/4
Marius Vlad [Mon, 1 Jun 2020 18:04:18 +0000 (21:04 +0300)]
layout: Remove black surface when trying to use migrate views to other
outputs

We install a black surface in the fullscreen layer for each output, and
we need to remove it before adding the new surfaces/views. We did that
aleady for 'remote' type of surfaces when categorizing the type, but
here we use the configuration file to determine the output, but we were
missing the black surface for that output. This verifies that the black
surface for that output is in use, and removes the black surface if so.

Bug-AGL: SPEC-3280

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

3 years agosrc/: Use agl-shell-app-id to set-up views on a different output 58/24658/3
Marius Vlad [Mon, 1 Jun 2020 15:31:22 +0000 (18:31 +0300)]
src/: Use agl-shell-app-id to set-up views on a different output

This makes it easier to specify the application directly in the
configuration file, without the ned to modify the application code.

Bug-AGL: SPEC-3280

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

3 years agolayout: Add a wrapper to print out the surface role 57/24657/4
Marius Vlad [Fri, 29 May 2020 21:14:24 +0000 (00:14 +0300)]
layout: Add a wrapper to print out the surface role

With this we add a few more debug statements to the log file.
Nothing too spurious but helps debugging more quickly if needed.

Bug-AGL: SPEC-3280

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

3 years agosrc: Insert a black surface/remove it when the last remote 56/24656/2
Marius Vlad [Fri, 29 May 2020 18:46:53 +0000 (21:46 +0300)]
src: Insert a black surface/remove it when the last remote
surface role is present

Bug-AGL: SPEC-3280

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

3 years agolayout, desktop: Treat the remote surface role like the desktop one 55/24655/2
Marius Vlad [Fri, 29 May 2020 18:29:41 +0000 (21:29 +0300)]
layout, desktop: Treat the remote surface role like the desktop one

Necessary changes so that we can handle the remote surface just like the
regular desktop one. We use the same code when committing the surface
but modify the completion part to only modify the pending output as to
avoid remote surfaces interfering with the enum representing each
surface type.

Bug-AGL: SPEC-3280

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

3 years agolayout: Remove the quirks as now we have the policy hooks in place 54/24654/2
Marius Vlad [Fri, 29 May 2020 18:12:24 +0000 (21:12 +0300)]
layout: Remove the quirks as now we have the policy hooks in place
to handle that

With the policy hooks in place we no longer need this quirk to activate
surfaces by default when starting up, and was potentially seen as hole
to bypass the policy hooks. Remove it and just allow the policy hook to
control how that happens.

Bug-AGL: SPEC-3280

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

3 years agosrc/: Add the remote surface role 53/24653/2
Marius Vlad [Fri, 29 May 2020 17:41:58 +0000 (20:41 +0300)]
src/: Add the remote surface role

This patch adds the 'remote' surface role, which clients can make use of
to hint the compositor that it should place the surface on other
output.

While both private extension protocols (agl-shell and agl-shell-desktop)
explicitly  require a wl_output when activating or when setting surface
roles, we still need the inform the compositor that the surface should be
placed on another output.

This is due to the activate_by_default functionality that requires
having an output being present, with the default regular XDG desktop
role deriving its output by using the output of the backgound surface
(which is being normally set by the client shell).

Just like pop-up dialog role and split surface role this patch adds
another temporary hold up place before the surface is actually created.

Bug-AGL: SPEC-3280

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

3 years agosrc/: Add all surface roles to a wrapper for retrieving the output
Marius Vlad [Fri, 29 May 2020 17:16:08 +0000 (20:16 +0300)]
src/: Add all surface roles to a wrapper for retrieving the output

Adds the other surface roles to the it.

Bug-AGL: SPEC-3280

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

3 years agolayout: Do not attempt to activate a split or a fs surface 11/24511/8
Marius Vlad [Sat, 2 May 2020 15:20:20 +0000 (18:20 +0300)]
layout: Do not attempt to activate a split or a fs surface

As long as there is (an already created) surface in a split/fs type of role
there's no point in trying to activate it. Users can mistakenly try to
do that so have some logic in place to avoid it.

Bug-AGL: SPEC-3334

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

3 years agolayout: Resize the active surface when doing the split 10/24510/8
Marius Vlad [Fri, 1 May 2020 11:31:07 +0000 (14:31 +0300)]
layout: Resize the active surface when doing the split

This adds an intermediate geometry variable which is used to save and
restore to the original available geometry when destroying the split
surface. This takes care to inform the client that a new resize is
needed when the split surface is destroyed or when the split surface
is committed.

The width and height of the split surface is derived from the available
geometry area size (the available size of the background surface) but
this can further adapted to be based on the split window size (that is,
it could be specified by the client). This assumption is there to
simplify the implementation.

Bug-AGL: SPEC-3334

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

3 years agolayout: Allow to commit the fullscreen and split surface roles 09/24509/8
Marius Vlad [Wed, 29 Apr 2020 14:41:58 +0000 (17:41 +0300)]
layout: Allow to commit the fullscreen and split surface roles

Now that we have the ability to discern between fullscreend and
split roles, use specific functions when doing the commit to further
customize them.

Bug-AGL: SPEC-3334

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

3 years agolayout: Remove unused ivi_compositor reference 08/24508/8
Marius Vlad [Tue, 12 May 2020 21:44:19 +0000 (00:44 +0300)]
layout: Remove unused ivi_compositor reference

Removes a unused warning about ivi_compositor.

Bug-AGL: SPEC-3334

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