Skip to content

Allow changing monitor configuration policy

Jonas Ådahl requested to merge jadahl/mutter:wip/monitor-config-policy into main

This merge request contains three relevant changes:

  • Be more forgiving when parsing monitors.xml. This is so we in the future can more easily add things to it without causing regressions.
  • Allow overriding the order of monitor configuration files, so one e.g. can on a system level disable user level configuration files.
  • Allow disabling D-Bus configurability.

This that could potentially be added as well are e.g. disabling hotkeys etc, but didn't go that far yet.

To make it slightly easier to know how it looks like, I'm copying two relevant parts of the newly added documentation, that describes the new changes:


Configuration policy

The monitor configuration policy determines how Mutter configures monitors. This can mean for example in what order configuration files should be preferred, or whether configuration via Settings (i.e. D-Bus) should be allowed.

The default policy is to prioritize configurations defined in the user level configuration file, and to allow configuring via D-Bus.

Changing the policy is possible by manually adding a <policy/> element inside the <monitors version="2"/> element in the monitors.xml file. Note that there may only be one <policy/> element in each configuration file.

Changing configuration file priority policy

To change the order of configuration file priority, or to disable configuration files completely, add a <stores/> element inside the <policy/> element described above.

In this element, the file policy is defined by a <stores/> element, which lists stores with the order according to prioritization. Each store is specified using a <store/> element with either system or user as the content.

Example of only reading monitor configuration from the system level file:

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

Example of reversing the priority of monitor configuration:

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

Changing D-Bus configuration policy

D-Bus configureability can be configured using a <dbus/> element in the <policy/> element. It's content should either be yes or no depending on whether monitor configuration via D-Bus should be enabled or disable.

Example of how to disable monitor configuration via D-Bus:

<monitors version="2">
  <policy>
    <dbus>no</dbus>
  </policy>
</monitors>

Merge request reports