summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2022-11-01 17:42:43 +0200
committerMarius Vlad <marius.vlad@collabora.com>2022-11-01 18:25:25 +0200
commit77d94d831dfcdb4e173cd5253d94ec724d576e77 (patch)
tree4191f5ed4a657b9dc46b240892c7565487ca70e0
parent924473ef016ba8dcfa863861740be2289421313d (diff)
agl-shell: Add support for defining an activation area
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
-rw-r--r--protocol/agl-shell.xml29
-rw-r--r--src/shell.c25
2 files changed, 50 insertions, 4 deletions
diff --git a/protocol/agl-shell.xml b/protocol/agl-shell.xml
index ad5553d..bf5ab02 100644
--- a/protocol/agl-shell.xml
+++ b/protocol/agl-shell.xml
@@ -22,7 +22,7 @@
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
</copyright>
- <interface name="agl_shell" version="3">
+ <interface name="agl_shell" version="4">
<description summary="user interface for Automotive Grade Linux platform">
Starting with version 2 of the protocol, the client is required to wait
for the 'bound_ok' or 'bound_fail' events in order to proceed further.
@@ -174,6 +174,31 @@
<arg name="state" type="uint" enum="app_state"/>
</event>
-
+ <request name="set_activate_region" since="4">
+ <description summary="sets a specific region to activate">
+ A hint for the compositor to use a custom area, rather than
+ inferring the activation area. If any panels are used
+ the compositor computes the activation area by subtracting the
+ panels geometry area. If no panels are used then the entire output
+ is being used. This request changes that as to hint the compositor
+ to use the supplied rectangle and ignore any potential panels
+ that might been set-up previously.
+
+ In order for this request to take effect it will need to happen
+ before the 'ready' request in order for the compositor to make use of it.
+ Note that any 'set_panel' request be will not be honored, if this request
+ has been called.
+
+ The x and y coordinates use the top-left corner as the origin. The
+ rectangle area shouldn't exceed the output area, while an area smaller
+ than the output, would basically result in showing up the background
+ surface.
+ </description>
+ <arg name="output" type="object" interface="wl_output"/>
+ <arg name="x" type="int" summary="x position of rectangle"/>
+ <arg name="y" type="int" summary="y position of rectangle"/>
+ <arg name="width" type="int" summary="width of rectangle"/>
+ <arg name="height" type="int" summary="height of rectangle"/>
+ </request>
</interface>
</protocol>
diff --git a/src/shell.c b/src/shell.c
index 96f5c63..032e114 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1426,12 +1426,33 @@ shell_destroy(struct wl_client *client, struct wl_resource *res)
{
}
+static void
+shell_set_activate_region(struct wl_client *client, struct wl_resource *res,
+ struct wl_resource *output, int x, int y,
+ int width, int height)
+{
+ struct ivi_compositor *ivi = wl_resource_get_user_data(res);
+ struct weston_head *head = weston_head_from_resource(output);
+ struct weston_output *woutput = weston_head_get_output(head);
+ struct ivi_output *ioutput = to_ivi_output(woutput);
+
+ struct weston_geometry area = { .x = x, .y = y,
+ .width = width,
+ .height = height };
+ if (ivi->shell_client.ready)
+ return;
+
+ ioutput->area_activation = area;
+}
+
+
static const struct agl_shell_interface agl_shell_implementation = {
- .destroy = shell_destroy,
.ready = shell_ready,
.set_background = shell_set_background,
.set_panel = shell_set_panel,
.activate_app = shell_activate_app,
+ .destroy = shell_destroy,
+ .set_activate_region = shell_set_activate_region
};
static void
@@ -1659,7 +1680,7 @@ int
ivi_shell_create_global(struct ivi_compositor *ivi)
{
ivi->agl_shell = wl_global_create(ivi->compositor->wl_display,
- &agl_shell_interface, 3,
+ &agl_shell_interface, 4,
ivi, bind_agl_shell);
if (!ivi->agl_shell) {
weston_log("Failed to create wayland global.\n");