monitor-config-store: Add way to define config store loading policy

This adds a way to define a way, at the system level, to define a policy
of how monitor configuration files are loaded.

The intended use case is to e.g. either prefer system level monitor
configurations before user levels, or only allow system level
configurations.

Examples:

Prefer system over user level configurations:

    <monitors version="2">
      <policy>
        <stores>
          <store>system</store>
          <store>user</store>
        </stores>
      </policy>
      <configuration>
        ...
      </configuration>
    </monitors>

Only allow system level configurations:

    <monitors version="2">
      <policy>
        <stores>
          <store>system</store>
        </stores>
      </policy>
      <configuration>
        ...
      </configuration>
    </monitors>

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2030>
This commit is contained in:
Jonas Ådahl
2022-01-17 11:45:53 +01:00
committed by Marge Bot
parent 6c4380ed41
commit c611b64c53
13 changed files with 452 additions and 95 deletions

View File

@ -7690,6 +7690,7 @@ meta_test_monitor_migrated_rotated (void)
if (!meta_monitor_config_store_set_custom (config_store,
"/dev/null",
migrated_path,
META_MONITORS_CONFIG_FLAG_NONE,
&error))
g_error ("Failed to set custom config store files: %s", error->message);
@ -7832,6 +7833,7 @@ meta_test_monitor_migrated_wiggle_discard (void)
if (!meta_monitor_config_store_set_custom (config_store,
"/dev/null",
migrated_path,
META_MONITORS_CONFIG_FLAG_NONE,
&error))
g_error ("Failed to set custom config store files: %s", error->message);
@ -8103,6 +8105,7 @@ meta_test_monitor_migrated_wiggle (void)
if (!meta_monitor_config_store_set_custom (config_store,
"/dev/null",
migrated_path,
META_MONITORS_CONFIG_FLAG_NONE,
&error))
g_error ("Failed to set custom config store files: %s", error->message);