summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2023-08-29grpc-proxy: Add dynamic floating window movementMarius Vlad8-11/+83
This adds basic movement for floating type of windows. The window needs to be a floating type for this request to work out. For the agl-shell protocol, this adds a set_app_float() request while for gRPC it adds a SetAppPosition() request. Bug-AGL: SPEC-4863 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I5ecc4257c3e84d15a8cabb183757753be37867f5
2023-08-17desktop: Fix Xwayland buildMarius Vlad1-0/+8
Turns out weston doesn't install xwayland-api header if Xwayland is not installed, which is a shame, and should be rectified. Meanwhile, let's guard access to the header and the API that the header exports. Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I77638b263483628f8cc7a3dcbd08c8947db1d86b
2023-08-03compositor: Use the logging context when iterating over scopesMarius Vlad1-1/+1
In accordance to the upstream changes refer to the logging context rather than the compositor instance. Depends on https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/29064 Bug-AGL: SPEC-4861 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I4a8aeac4ef33e0631c23ae85347fea8a1b36c4de
2023-07-24layout: Check against app_id being validMarius Vlad1-1/+1
All app_ids are not valid for xwayland type of surfaces to need to check against it. Bug-AGL: SPEC-4847 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I84dc9b493648f4fe48b1c23c8ead0283505acce0
2023-07-24layout: Determine xwayland surface in a generic fashionMarius Vlad3-4/+26
This provides a far better way of determining if the surface is xwayland or not. We can then make sure all X11 clients can be displayed. Bug-AGL: SPEC-4847 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I2140c452c0d37a84323eaf75787eb32a7771a56e
2023-06-21compositor: Add XWayland basic supportMarius Vlad7-25/+333
This allow starting up XWayland and the ability to display, albeit is incomplete, given that we have no way at this moment to make the window maximized, as we do with xdg-shell/native wayland applications. A further patch, together with libweston changes are needed to make this complete. For now this can provide us with initial smoke testing. Tested with basic X11 clients, including Unigine, which is the reason for having this the moment. Note that this at the moment compiled-out, requiring the pass -Dxwayland=true when building the compositor. Bug-AGL: SPEC-4782 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I87d2a852165cb3f03482bea1e04931bdd6d4c115
2023-06-13layout: Give ini config precedence over agl_shellMarius Vlad1-0/+6
The activation area can set-up with agl_shell as well, so give the ini configuration file precedence over the one set-up by agl_shell. Bug-AGL: SPEC-4829 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ifae82b8c29575e7a9a06422588ad6a8cce80946e
2023-06-13shell: Don't reset the activation area alwaysMarius Vlad1-2/+4
Rather than doing that always, be more selective, and perform it if we had already an application active. Bug-AGL: SPEC-4829 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I707f92d1cc1f820af493bae9daa5a948aa452ad8
2023-06-13layout: Add a fallback for reading activation-areaMarius Vlad3-1/+22
This is a temporary work-around for doing another read of the ini file for the activation-area in case we detected that we have one set-up but the activation area is empty. This happens when we're getting the ready() request from the shell client, when we're initializing the layout. Bug-AGL: SPEC-4829 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I152e7cba34b74390de2a46df4799c1fb44441d3f
2023-05-31policy-deny: Remove SMACK supportMarius Vlad3-91/+0
Similar to Waltham, SMACK hasn't been really used and it was actually a compile option, showing as a example the deny policy. The RBA and the allow-all policy still available, and we can revisit the policy mechanism if we plan on switching to SELinux. Bug-AGL: SPEC-4806 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Iedac63585676ebc47201debcf73870cb0538cc09
2023-05-31compositor: Remove Waltham supportMarius Vlad6-237/+0
Waltham hasn't been used in a while, its support has been removed for some time, we've been deprecating it last release so it's time to remove it from the compositor as well. Bug-AGL: SPEC-4669 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Iaf1e467b1228051fd96cac424ac6781d67f9fefa
2023-05-15clients/screenshooter: Add the output name to screenshot nameMarius Vlad1-83/+44
And split the screenshot in multiple files, to match each output. Bug-AGL: SPEC-4788 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I6d9e545c05ff949900f0158720888eb757c2c271
2023-05-04compositor: Let the user know about the debug scopes availableMarius Vlad1-0/+18
Bug-AGL: SPEC-4593 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I79d4447b7768b72712e244504782a33ba257a33d
2023-05-04compositor: Add support for subscribing to libweston scopesMarius Vlad1-1/+32
This brings in support to pass, over the command line, debug scopes that can help out debug issues with HW with other components or with libweston itself. One particular importance is the drm-backend debug scope. Bug-AGL: SPEC-4593 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I7a182ffe0b2b9bfdeced184514283265bb17c607
2023-05-03shell: Add the ability to dynamically move application windowMarius Vlad4-6/+42
So far, we could start an application on a different output, but moving them back-and-worth wasn't really supported. This handles a few use-cases like: - move an application's window from one output to another - install black curtain in case we no longer have any other surfaces on that output; - deactivate and switch to the previous active window in case there's one available - the activation is handled by the shell client, while deactivation is done implicitly by the compositor to simplify the shell client This does a bit of rewording of a function that returns true whenever we have only a single application window on a particular output. Bug-AGL: SPEC-4673 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I58cde58c6a2e2dade93566bfd7aff5ed697f5450
2023-05-03layout: Fix no-op check due to invalid checksMarius Vlad1-1/+3
Checking both width and height isn't a strict requirement, either can different. This unties the check such that we can actually move windows/applications between different outputs. We also add here an explicit surface damage as we're removing the view from the layer. Bug-AGL: SPEC-4773 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ie91b8c0fd2e9357fe00fd693e2a70fa3b4b4d31a
2023-05-03desktop: Look for app_ids after the initial commitMarius Vlad1-1/+9
Some applications, set up their app_ids after the initial surface commit, which is too late to move them/place them to a different output. This addresses that in the case the application sets one up, after the initial surface commit. Bug-AGL: SPEC-4759 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I4762af1ba6e8708722385ac06c37486dd4b6aac1
2023-05-03src: Send out the output name for the remote roleMarius Vlad3-2/+9
A while ago we switched to activation-by-default turned off which passes the responsability of activating applications to the shell client. The shell client uses the app_id to indentify the application to display, and the output. The output would normally be hard-coded to the first available output but there is nothing that prevents the shell to display it on other outputs. This patch does just that, it would allow the user use configurable option in the ini file, under the [output], agl-shell-app-id=app_id, by re-using the event from the compositor sent to the shell client to pick up a different output, the one specified in the section entry. Bug-AGL: SPEC-4529 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ieea1a28fe6776ecc691fd38da9b4c3495ac5a5ea
2023-04-27layout: Split remote from desktop roleMarius Vlad4-34/+60
Though there's no difference between the desktop and remote role this would simplify handling, and with it we remove the implicit activation of surfaces, which wasn't addressed when we switched to activate-by-default=false by default. Bug-AGL: SPEC-4673, SPEC-4759, SPEC-4529, SPEC-4756 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ia5e57155ed26c53958e0e9590be04f91c5de1c28
2023-04-27grpc-proxy: Added set_app_output requestMarius Vlad8-10/+145
This is identical to the remote role, but I feel this conveys more information than remote role, as remote denotes that the output is displayed on another device, which it isn't always the case (the system has multiple outputs all connected directly). This introduces two new additions to the agl-shell protocol, a request to use a different output to display/show the application and an event to inform the shell client to use as a map between the application id and its output. The event is necessary to let the shell client know which output to activate the application on. This requests implements a wrapper for gRPC that maps 1-to-1 to the agl-shell request. There's no gRPC subscription similar to the event though. Bug-AGL: SPEC-4673 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I070e9fdbafd5616f3a98415193bf846aeaee9a4a
2023-04-06compositor: Don't reuse previous return valuesMarius Vlad1-1/+1
In case we couldn't enable the output do not return early without setting the proper return value. This causes an issue later one, because the signal list isn't initalized, taking down the compositor with a crash. Bug-AGL: SPEC-4734 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ia5ebc226f6b8f702e710a5976c471d04302bcb00
2023-03-15meson.build: Add an explicit weston dependencyMarius Vlad4-3/+4
Required when building the compositor locally, without yocto/OE as weston cflags includes the full path to weston. Bug-AGL: SPEC-4725 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: If3a4e8238cb40c6fbe0db26bd1056fce48243038
2023-03-15meson.build: Remove any prefix assumptionsMarius Vlad1-15/+0
This forces to create a include directory by hand, which we don't seem to be needing. This only affected the cases where we build the compositor locally, without yocto/OE. Bug-AGL: SPEC-4725 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ic279714671809eae2362da9fccaf592f10f2b888
2023-03-03grpc-proxy: Add set_app_fullscreen functionalityMarius Vlad9-8/+157
This implements set_app_fullscreen which clients can set-up before being mapped. The worthwhile change here was the fact that transitioning between fullscreen, normal, and float would cause invalid tracking of the active window when switching between these states. This would make floating operation display the incorrect active window, so in order to reconcile that, we only update the previous surface if it is different that the current active one. Otherwise this fairly similar to set_app_float. Bug-AGL: SPEC-4673 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ie912c86ff7ac38d034cf4d97b2adbc5ef47ce9d3
2023-03-03shell: Reset normal state when getting back to maximizedMarius Vlad1-0/+1
When resetting back to normal, maximized state, reset also the state, just in case we might to check it up latter on. Bug-AGL: SPEC-4673 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I0107e6963c01bde22a5a3ab30f392cb618a4f258
2023-03-01protocol: Add set_app_normal requestMarius Vlad8-0/+97
This request allows transitioning back from other roles like float/split/fullscreen to regular maximized, normal state. Bug-AGL: SPEC-4673 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Id7f04ffee193677621bd32860998457498acc388
2023-03-01protocol, grpc-proxy: Add support for set_app_floatMarius Vlad9-8/+122
Add support for setting a window as float/popup. This allows either the application itself be set-up as float, or from other gRPC clients. Bug-AGL: SPEC-4673 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ic7ee8203cd9c4dfcc51b7fc9709f35be504ae9d0
2023-03-01protocol/grpc-proxy: Add deactivate_app requestMarius Vlad4-6/+36
This request will hide the currently active window, and activate either the background or the previously active window. This request mimics the agl-shell-desktop request, actually using the same code path. It only handles regular windows and float/pop-up. Once we add other roles like fullscreen/split we can improve on this. Bug-AGL: SPEC-4673 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I593cda5d008dfc32fe5e3b079fad9450dc1a490d
2023-02-15compositor: Added layout_save/layout_restoreMarius Vlad3-0/+99
In order to send correct dimensions after a hot-plug event, we need to be able to save the area we had before. Note that implies that the connectors do not change names in between hot-plugs, which normally doesn't happen, but it might if udev rules are executed/invoked. We restore based on output name it had previously. Bug-AGL: SPEC-4705 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ice3a127edfc9d356830ba8f0d0a20bb86284d7de
2023-02-15shell: Check for a valid ivi_surfaceMarius Vlad1-1/+2
A hot-plug/re-plug event means we remove the black curtain with it the ivi_surface that hangs out of it, so verify it before assuming there's one installed. Bug-AGL: SPEC-4705 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Iad53ae34b4e15b5962cf984978a65c344aac9200
2023-02-15shell: Check for invalid outputs passed on when activatingMarius Vlad1-4/+14
Connector hot-plugging would generate new wl_output object, which the client might re-use so rather than blindly trusting the client, make sure that the output we're getting is really one suitable. This should avoid getting an incorrect output upon re-plugging in a connector. Bug-AGL: SPEC-4705 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I732283fc16841e0e57ddbec5d8bd2333d5028433
2023-02-15compositor: Fix memleak when disabling the outputMarius Vlad1-0/+1
Turns out we're leaking out the app_ids when disabling the output so turn that memleak off. Bug-AGL: SPEC-4705 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ia2d46ecd1748c078e924d8d6c90bd86e9c49f64c
2023-01-29ivi-compositor: Add support for multiple app_idsMarius Vlad3-8/+29
Verify if more than one app_id is being passed in the agl-shell-app-id to allow more than one appid being placed to that output. Bug-AGL: SPEC-4666 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I79dc77564ffca41148832af597b6836d7d28f686
2023-01-29meson: Deprecate waltham and inform users of thatMarius Vlad2-1/+10
Waltham isn't really used, this is a step forward removing support for it. For now just add an configuration option if users still want to use it. Bug-AGL: SPEC-4670 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I5ec900ef075717b438ef9e41167ad4833b2a8b87
2023-01-29meson: Bump to version 0.0.21Marius Vlad1-2/+2
We should probably cut and update the compositor to a newer version as gRPC support is a big change to have. Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Iac400a3d2f0e62c5fe3b2ab0f681ce228a1865db
2023-01-17shell: Reset the area activationMarius Vlad1-0/+3
Re-starting the shell client wouldn't reset the activation area, which might be rather confusing, so better be re-initialize it as to be able to switch in-between various configurations. Bug-AGL: SPEC-4674 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ib964ebed2c189f82092ffcf4d54dee2cf22093e1
2023-01-05shell: Verify agl-shell version for bound_ok/bound_failMarius Vlad1-7/+18
Some additional checks to avoid cases where agl-shell is still using the version 1 but we're checking against at least version 2 (where we introduced some additional events). Part of the compat series. Bug-AGL: SPEC-4667 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I4f5d34fd8b9fe6cf6b8097948afebee550f5345d
2023-01-05shell: Add fallback agl-shell version 1Marius Vlad1-0/+5
Turns out I made a mistake making all clients with version 1 not able to bind to agl-shell anymore. Rather than doing that still allow older clients to bind to agl-shell. Bug-AGL: SPEC-4667 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I61224f39dd8b0d96b36695f536eed8e701130877
2022-12-28input: Fix minor issue while reporting disable cursorMarius Vlad1-2/+2
We actually reported the cursor being disabled when it fact it was not. Bug-AGL: SPEC-4658 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I81ee23e4ef2621c96344ce526a7b53d235d325e3
2022-12-28input: Rename hide-cursor to disable-cursorMarius Vlad3-17/+18
Since hide-cursor doesn't hide the cursor but disables the pointer, better rename it to something much more appropriate. While doing that, move also move the ini entry retrieval where is also more suitable, along side the other parts that do that. Shouldn't be any functional change while doing that. Bug-AGL: SPEC-4658 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I8d1aab849b9a96177d17bb639c8e1e209205f7e7
2022-12-14src: Verify if the output is presentMarius Vlad1-3/+4
The output destroy handler will invalidate the weston output and with it we're no longer have access to it when the shell client closes up. This checks against the weston output to avoid an illegal memory access. Still part of the hot-plug connector fixes. Bug-AGL: SPEC-4625 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Reported-by: Detlev Casanova <detlev.casanova@collabora.com> Change-Id: Ic4c389422057fa082aff7fdbbc13af0c16f7bbb6
2022-12-14src: Further hotplug connector fixesMarius Vlad2-5/+9
Some further checks for the black curtain not being present always when perform hot-plugging operations. Bug-AGL: SPEC-4625 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Reported-by: Detlev Casanova <detlev.casanova@collabora.com> Change-Id: Ia7c05e5b90b9e8260f661a8115a93b0d246b9d98
2022-12-13grpc-proxy: Init gRPCsandbox/mvlad/grpc-async-cbMarius Vlad11-0/+1144
This brings in support for accessing agl-shell protocol indirectly by using a gRPC interface which bridges the communication between a particular client (the client issuing gRPC requests) and the AGL compositor which does that by re-using the same agl-shell protocol. In order to achieve that, and further more, to avoid having ifdefs code in the compositor and deal with threading, we instead resorted to using a helper client. On one side this helper implements the gRPC server API, and on the other, a wayland native client that implements the agl_shell interface. It uses the agl_shell_ext interface added previously to communicate with the compositor that it requires access to agl_shell interface as well. The helper expects that agl_shell interface was already bounded to another client before starting it so it waits until that happens and then it implements the protocol specification, for each interface. Launching the helper client automatically can be done by adding the following entry to the ini file: [shell-client-ext] command=/path/to/agl-shell-grpc-server The gRPC server implementation only handles the agl_shell interface until to this point, specifically, the activate_app request, and the events that were adedd with version 3 of the agl-shell protocol. Also the implementation uses the Reactor pattern, with Callback service that greatly simplifies the async version and avoids putting locks to to handle multiple clients. This should allow multiple clients being connected to the gRPC server and receive events / send requests. Bug-AGL: SPEC-4503 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ie870da3caa138394d8dd30f9d22a5552d585d63a
2022-12-05shell: Not not override the agl_shell interface resourcesMarius Vlad1-22/+30
This redoes a bit the way we assigned wl_resources created in case we got a bound_ok or bound_fail event. Previously, even if we get a 'bound_fail' event we would override the shell_client.resource which would make activation of the legitimate shell client impossible, so this change would make the shell_client.resource not being set if that happens. Secondly, this includes a reset change in the agl_shell destructor, a reset which is implicitly being done when the correct operations for the protocol specifications have been applied. Bug-AGL: SPEC-4503 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ie87ce3b937f041a5704407593f580895f188ef56
2022-12-05shell: Add a wrappers for sending events with agl-shellMarius Vlad4-25/+31
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. Bug-AGL: SPEC-4503 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I869b036d6f24beeb3089bfd24b8d233c5fada71f
2022-12-05compositor: Allow to start other clientsMarius Vlad3-10/+14
This introduces shell-client-ext as a new section entry to add to allow starting the gRPC server helper client. Bug-AGL: SPEC-4503 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I41d62c932648699aa21837afc2de5103912c370d
2022-12-05agl-shell.xml: Introduce a new interfaceMarius Vlad3-7/+150
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. Bug-AGL: SPEC-4503 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Iac1d840a5f917b2a92fdfbdcdc583144d3942a1c
2022-11-25compositor: Handle output destruction deferralMarius Vlad1-1/+14
weston_head_detach() already handles the disable of the output if it's the last one. See also: https://gitlab.freedesktop.org/wayland/weston/-/issues/697 Bug-AGL: SPEC-4625 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I542b14905b7b6aa220142d0d2dd5cec922c4fc33
2022-11-14layout: Allow background surface roles (to) be activatedMarius Vlad2-8/+35
While nothing technically prevents the background surface role to be activated, it turns out we don't actually track it so we a) couldn't find it, and b) we attempted to resize it to an incorrect dimension. Another small follow-up commit from 'Add manual activation area configuration option' and with with commit 'agl-shell: Add support for defining an activation area', which introduced the ability to designate a certain area as the activation area. v2: Keep the background surface always mapped We now have more than one active surfaces at the same time, so we can't unmap it as it needs to be always displayed. Bug-AGL: SPEC-4594 Reported-by: Scott Murray <scott.murray@konsulko.com> Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I2561ce2c4c1c96c796fb8ee1c8ca9a30772b71f9
2022-11-01agl-shell: Add support for defining an activation areaMarius Vlad2-4/+50
This introduces a new request, 'set_activate_region' that hints to the compositor to use a defined rectangle area, rather than to infer it. This is a follow-up from commit 924473ef016ba8dcfa863, 'Add manual activation area configuration option' which brough in the same feature but by using the ini configuration file. Bug-AGL: SPEC-4594 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: If9395268e68de6b0d01f04b90822e06603808299