summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2020-10-08main: Create black surface after listening socketWalter Lozano1-2/+2
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
2020-09-30main: Use a configuration option for hidding out the cursorMarius Vlad1-3/+2
Bug-AGL: SPEC-3580 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I3504fc2c6dda3c10a67a23e68126201acd4ba455
2020-09-30main: Enable screenshoter interface when debug option is passedMarius Vlad1-1/+2
Bug-AGL: SPEC-3580 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I9adf8c707991301f5cf214b492ce3c6ee45997e2
2020-09-30input: Add basic seat handlingMarius Vlad5-1/+267
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
2020-09-30client/screenshooter: Client for taking screenshotsMarius Vlad7-0/+971
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
2020-09-30screenshooter: Add agl-screenshooter protocolMarius Vlad5-0/+229
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
2020-09-28layout: Set active output NULL when displaying backgroundWalter Lozano1-0/+1
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
2020-09-10layout: Activate by default xdg surface that do not have an app_id setjellyfish_9.99.4jellyfish/9.99.49.99.4Marius Vlad2-5/+34
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
2020-09-10layout: If no valid output found, abort early with a protocol violationMarius Vlad1-0/+9
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
2020-07-29layout: Add missing hooks for other surface rolesjellyfish_9.99.3jellyfish/9.99.39.99.3Marius Vlad1-0/+28
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
2020-07-29layout: Advertise state change for other types of surface rolesMarius Vlad3-2/+26
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
2020-07-29shell: Assume consistency with the desktop rolesMarius Vlad1-0/+4
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
2020-07-14policy-*: Remove any private binding restrictions for allow-all policyjellyfish_9.99.2jellyfish/9.99.29.99.2Marius Vlad2-51/+49
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
2020-07-03desktop: Fix destruction of applications that fallback to the desktop roleMarius Vlad1-2/+7
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
2020-06-29shell: Avoid checking against surfaces that do not have an app_idMarius Vlad1-4/+4
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
2020-06-26README: Add a few words about the deny-all policy enginejellyfish_9.99.1jellyfish/9.99.19.99.1Marius Vlad2-6/+14
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
2020-06-26desktop: Allow desktop_api to handle surface removalMarius Vlad1-3/+7
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
2020-06-26policy: Add a deny-all policy as an exampleMarius Vlad3-1/+220
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
2020-06-26policy-default: Use libsmack to check client labelMarius Vlad2-0/+54
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
2020-06-26policy: Add a new policy hook to restrict access to private extensionsMarius Vlad3-1/+33
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
2020-06-24desktop: Avoid referencing the output's surface for pending surfacesMarius Vlad1-0/+7
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
2020-06-16doc: Added arch diagramMarius Vlad3-0/+1762
Bug-AGL: SPEC-3386 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: If98632458b11f3fce0843fbf44e34d04bc1320cf
2020-06-16README: move README.md to doc/Marius Vlad1-0/+0
Bug-AGL: SPEC-3386 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: If1acb6f0c4cfb9cdfa16e9fb8b57b29a1a596459
2020-06-15layout: Clip the view to the size specified by width and heightMarius Vlad1-9/+9
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
2020-06-15shell: Pass the bounding box values to the pop-up surfaceMarius Vlad2-5/+26
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
2020-06-15agl-shell-desktop: Add the ability to pass width and height asMarius Vlad1-3/+29
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
2020-06-15shell: Advertise application_id event for other surface rolesMarius Vlad1-7/+21
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
2020-06-15layout: Do not attempt to activate the surface on the remote outputMarius Vlad1-0/+10
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
2020-06-15src: Mark surfaces with the 'remote' role if configuration file says soMarius Vlad5-4/+18
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
2020-06-15main: Do the installment of black surfaces for remote outputs as wellMarius Vlad1-2/+2
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
2020-06-15shell: Add some extra checks to make sure we don't trip ourselvesMarius Vlad1-2/+18
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
2020-06-15main: Enable remote outputs later than local (DRM) outputsMarius Vlad1-20/+29
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
2020-06-15main, layout: Minor clean-ups and added some further loggingMarius Vlad2-30/+14
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
2020-06-15main: Retrieve the agl-shell-app-id from the config fileMarius Vlad1-0/+1
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
2020-06-15main: Retrieve the transform and scale from config fileMarius Vlad1-3/+12
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
2020-06-15src: Create an ivi_output for the remote outputMarius Vlad1-14/+51
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
2020-06-15src: Hold a reference for remoting_api in the ivi_compositorMarius Vlad2-6/+9
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
2020-06-15main: Add the ability to load the remote pluginMarius Vlad3-0/+250
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
2020-06-15desktop: Remove commiting code for the panelMarius Vlad3-73/+1
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
2020-06-15shell: Do not remove the black surface if we don't have a backgroundMarius Vlad1-1/+2
set for that output Bug-AGL: SPEC-3280 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I07ca7108e37dcdb992de0e2223bde3f9fa200863
2020-06-15desktop: Display a black surface for apps being moved using config fileMarius Vlad1-3/+9
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
2020-06-15layout: Remove black surface when trying to use migrate views to otherMarius Vlad1-0/+7
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
2020-06-15src/: Use agl-shell-app-id to set-up views on a different outputMarius Vlad3-9/+46
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
2020-06-15layout: Add a wrapper to print out the surface roleMarius Vlad3-4/+57
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
2020-06-14src: Insert a black surface/remove it when the last remoteMarius Vlad3-5/+40
surface role is present Bug-AGL: SPEC-3280 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ia47c0539ff26d1378bb9ac75e19592d7b8b2b3bf
2020-06-14layout, desktop: Treat the remote surface role like the desktop oneMarius Vlad2-7/+55
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
2020-06-14layout: Remove the quirks as now we have the policy hooks in placeMarius Vlad3-25/+2
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
2020-06-14src/: Add the remote surface roleMarius Vlad4-0/+87
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
2020-06-08src/: Add all surface roles to a wrapper for retrieving the outputMarius Vlad3-15/+18
Adds the other surface roles to the it. Bug-AGL: SPEC-3280 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ia0c659bfd0dbf96d53ee6f24d3c4296b3ffdad2d
2020-06-08layout: Do not attempt to activate a split or a fs surfaceMarius Vlad1-2/+23
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