diff options
author | 2020-03-03 14:25:25 +0200 | |
---|---|---|
committer | 2020-03-04 13:19:01 +0200 | |
commit | 60e91c02c365355a94441eddc1851babeb440c73 (patch) | |
tree | 9cb729f265263cef9e3bc8e272ad50171c920874 /meson.build | |
parent | 3b38187d416182306e0533f17a6129a45a168f14 (diff) |
policy: Init policy framework
This patch adds the policy framework, comprised from hooks which a
policy engine can further customize, and which are checked upon surface
creation, commit and activation. Users should create specialized
versions of these callbacks when creating a policy engine.
Further more, it adds a protocol to add states, events and policy rules.
By default, the protocol has a few known states like 'start' or 'stop', but
also 'show' and 'hide' as events.
A policy rule allow to define the setup in which an event can happen
based on the state of the rule, the action event itself, the application and
(optional) an timeout.
The policy rules are there to specify the state, the event, and
application, but it is ultimately handled by a hook which will be called
to handle the event. The compositor will arrange to pass all that
information back to the handler, so the policy engine is in control to
check in what circumstances the policy rule can be satisfied.
These policy rules allow to handle transitional states which are common
in AGL. For instance:
If one would want to display the application 'navigation' in 3
seconds after and state has been changed to 'start', it should do
add the following rule:
('navigation', STATE_START, SHOW, 3000ms, main_output)
Then, when a 'start' state is propagated to the client shell and the
client shell will relay it back to the compositor (using the 'apply' request),
will arm an timer to execute the event handler after a 3000ms timeout.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ie03c5f9b1ddb964949e4f9797cbbe2dd2b32a6b6
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/meson.build b/meson.build index 640be2e..4d89c73 100644 --- a/meson.build +++ b/meson.build @@ -47,11 +47,13 @@ dir_wp_base = dep_wp.get_pkgconfig_variable('pkgdatadir') agl_shell_xml = files('protocol/agl-shell.xml') agl_shell_desktop_xml = files('protocol/agl-shell-desktop.xml') +agl_shell_policy_xml = files('protocol/agl-shell-policy.xml') xdg_shell_xml = join_paths(dir_wp_base, 'stable', 'xdg-shell', 'xdg-shell.xml') protocols = [ { 'name': 'agl-shell', 'source': 'internal' }, { 'name': 'agl-shell-desktop', 'source': 'internal' }, + { 'name': 'agl-shell-policy', 'source': 'internal' }, { 'name': 'xdg-shell', 'source': 'wp-stable' }, ] @@ -120,13 +122,16 @@ srcs_agl_compositor = [ 'src/main.c', 'src/desktop.c', 'src/layout.c', + 'src/policy.c', 'src/shell.c', 'shared/option-parser.c', 'shared/os-compatibility.c', agl_shell_server_protocol_h, agl_shell_desktop_server_protocol_h, + agl_shell_policy_server_protocol_h, agl_shell_protocol_c, agl_shell_desktop_protocol_c, + agl_shell_policy_protocol_c, xdg_shell_protocol_c, ] |