Skip to content

Store the monitor layout mode in monitors.xml and migrate existing configs

Jonas Dreßler requested to merge verdre/mutter:monitor-config-layout-mode into main

This MR gets the monitor config ready for enabling scale-monitor-framebuffer by default:

  • start out by removing the old migration code for migrating from v1 monitor.xml files, this migration (has been done in 2017)[bc316246] (so GNOME 3.26 includes it), and even RHEL 7 (with GNOME 3.28) has the new format already
  • make the layout mode a more explicit part of monitor configurations: Add the layout mode to MetaMonitorsConfigKey so that we can store and lookup the same configuration twice depending on layout mode.
  • add a <layout_mode> key to the <configuration> blocks in monitors.xml, so that we can have the same explicit storing in monitors.xml
  • since we have no way of knowing which layout mode existing configurations are in, introduce some detection code that detects the layout mode in case we didn't see a <layout_mode> entry. If the detection finds that an existing configuration can be interpreted as both LOGICAL and PHYSICAL layout, a MetaMonitorsConfig gets created for each layout mode.
  • finally, since this is the path that most users will go through when updating mutter, add "best effort" conversion code to migrate monitor configurations with scaled monitors from PHYSICAL to LOGICAL layout mode. It's introducing two algorithms to migrate 1-dimensional lines of monitors and simple 2-dimensional layouts
  • and in the end obviously add various tests to ensure all of these things are working

Merge request reports