1. 15 Apr, 2020 1 commit
    • Jonas Ådahl's avatar
      monitor-config-manager: Only use crtc transform for assignment · 43baf643
      Jonas Ådahl authored
      The CRTC level transform (i.e. not necessarily the one set on the
      hardware) is what is relevant for calculating the layout the CRTC will
      have on the stage, so only use the one that can be handled by the
      hardware for the CRTC assignment.
      This makes the CRTC layout valid for tiled monitors.
  2. 11 Mar, 2020 1 commit
  3. 25 Feb, 2020 1 commit
    • Jonas Ådahl's avatar
      crtc: Move configured state to separate struct · fe42d56d
      Jonas Ådahl authored
      To make it more reliable to distinguish between values that are read
      from the backend implementation (which is likely to be irrelevant for
      anything but the backend implementation), split out those values (e.g.
      This changes the meaning of what was MetaCrtc::rect, to a
      MetaCrtcConfig::layout which is the layout the CRTC has in the global
      coordinate space.
  4. 07 Feb, 2020 3 commits
    • Hans de Goede's avatar
      monitor-config-manager: honor accelerometer value changes when there is more than 1 monitor · bcbb44fd
      Hans de Goede authored
      Modify create_for_builtin_display_rotation to lookup the
      MetaLogicalMonitorConfig for the panel in the logical_monitor_configs
      list instead of only working when there is only 1 monitor.
      The goal of this change is to honor accelerometer value changes when there is
      more than 1 monitor.
      Note, since create_for_builtin_display_rotation is also used for handling the
      "rotate-monitor" hotkey and this commit modifies the common path of
      create_for_builtin_display_rotation this means that we will now also honor
      "rotate-monitor" hotkey keypresses when there is more than 1 monitor and
      update the builtin display rotation instead of ignoring "rotate-monitor"
      hotkey keypresses when there is more than 1 monitor. If this is deemed
      undesirable this is easy to fix, but I believe that doing things this way
      is more consistent.
    • Hans de Goede's avatar
      monitor-config-manager: Add clone_logical_monitor_config_list helper · 0d185b21
      Hans de Goede authored
      Add a clone_logical_monitor_config_list helper function for making a deep
      copy of MetaLogicalMonitorConfig lists.
      This is a preparation patch for honoring accelerometer value changes when
      there is more than 1 monitor.
    • Hans de Goede's avatar
      monitor-config-manager: Take device orientation into account for new configs · e4d5cb72
      Hans de Goede authored
      When creating a new config because of a monitor being (un)plugged or
      because of super+p being pressed, honor the orientation reported by
      the accelerometer for the internal panel.
      Before this commit we would always configure the internal panel with
      a normal / upright transform when e.g. an external monitor gets plugged
      in even if another transform was in use before plugging in the external
      monitor. This is inconsistent and causes problems for several use-cases.
      This commit fixes this by querying the accelerometer when creating a new
      config for an internal panel.
      Fixes: #707
      Fixes: #924
  5. 17 Mar, 2019 1 commit
  6. 21 Feb, 2019 2 commits
  7. 05 Dec, 2018 1 commit
  8. 08 Oct, 2018 1 commit
    • Daniel Drake's avatar
      monitor-manager: use MonitorsConfig to track switch_config · 6267732b
      Daniel Drake authored
      When constructing MetaMonitorsConfig objects, store which type
      of switch_config they are for (or UNKNOWN if it is not such
      type of config).
      Stop unconditionally setting current_switch_config to UNKNOWN when
      handling monitors changed events. Instead, set it to the switch_config
      type stored in the MonitorsConfig in the codepath that updates logical
      state. In addition to being called in the hotplug case along the same
      code flow that generates monitors changed events, this is also called
      in the coldplug case where a secondary monitor was connected before
      mutter was started.
      When creating the default linear display config, create it as a
      switch_config so that internal state gets updated to represent
      linear mode when this config is used.
      The previous behaviour of unconditionally resetting current_switch_config
      to UNKNOWN was breaking the internal state machine for display config
      switching, causing misbehaviour in gnome-shell's switchMonitor UI when
      using display switch hotkeys. The lack of internal tracking when the
      displays are already in the default "Join Displays" linear mode was
      then causing the first display switch hotkey press to do nothing
      (it would attempt to select "Join Displays" mode, but that was already
      Fixes: #281
  9. 18 Jul, 2018 1 commit
    • Bastien Nocera's avatar
      backend: Move lid-is-closed handling to MetaBackend · 95121965
      Bastien Nocera authored
      Rather than handle UpClient in both MetaBackend (to reset the idletime
      when the lid is opened), and in MetaMonitorManager and
      MetaMonitorConfigManager (to turn the screen under the lid on/off
      depending on its status), move the ability to get the lid status from
      UPower or mock it in one place, in MetaBackend.
  10. 25 Dec, 2017 2 commits
  11. 30 Nov, 2017 2 commits
    • Jonas Ådahl's avatar
      monitor-manager: Compare keys when checking whether a config is complete · b7518c86
      Jonas Ådahl authored
      We only counted configured monitors and whether the config was
      applicable (could be assigned), howeverwe didn't include disabled
      monitors when comparing. This could caused incorrect configurations to
      be applied when trying to use the previous configuration.
      One scenario where this happened was one a system with one laptop
      screen and one external monitor that was hot plugged some point after
      start up. When the laptop lid was closed, the 'previous configuration'
      being the configuration where only the laptop panel was enabled, passed
      'is-complete' check as the number of configured monitors were correct,
      and the configuration was applicable.
      Avoid this issue by simply comparing the configuration key of the
      previous configuration and the configuration key of the current state.
      This correctly identifies a laptop panel with the lid closed as
      inaccessible, thus doesn't incorrectly revert to the previous
    • Jonas Ådahl's avatar
      monitor-config-manager: Don't include closed laptop panel in config key · 62dedfbe
      Jonas Ådahl authored
      When deriving the list of disabled monitors when creating new monitors
      configs, don't include the laptop panel if the lid is currently closed,
      as we consider the laptop panel nonexistent when the laptop lid is
      closed when it comes to configuration.
      The laptop panel connector(s) will either way be appropriately disabled
      anyway, as the field listing disabled monitors in the configuration do
      not affect actual CRTC/connector assignments.
  12. 05 Oct, 2017 1 commit
  13. 02 Oct, 2017 1 commit
  14. 22 Sep, 2017 1 commit
    • Hans de Goede's avatar
      monitor-config-manager: Fix 90/270 degree rotation not working · 1035200f
      Hans de Goede authored
      When rotating 90/270 degrees we need to swap width and height. This fixes
      the screen going black and the following errors showing in the journal:
      gnome-shell[1097]: Failed to set CRTC mode 800x1280: No space left on device
      gnome-shell[1097]: Failed to flip: Device or resource busy
      gnome-shell[1097]: Failed to set CRTC mode 800x1280: No space left on device
      gnome-shell[1097]: Failed to set CRTC mode 800x1280: No space left on device
      When rotating a tablet with accelerometer 90/270 degrees.
  15. 20 Sep, 2017 1 commit
  16. 21 Aug, 2017 3 commits
    • Jonas Ådahl's avatar
      monitor-config-manager: Keep short history of configurations · b140e7fb
      Jonas Ådahl authored
      In order to go back in monitor configurations, save them to a history.
      The history is implemented as a max 3 element long queue, where newly
      set configurations are pushed to the head, and old are popped from the
      The difference between using a single previous config reference and a
      queue is that we can now remember the configuration used prior to a
      D-Bus triggered configuration when the user discarded the configuration.
      This will later be used to restore a previous configuration when a
      laptop lid is opened.
    • Jonas Ådahl's avatar
      Migrate old monitor configuration files to new system · bc316246
      Jonas Ådahl authored
      This commit changes the new configuration system to use monitors.xml
      instead of monitors-experimental.xml. When starting up and the
      monitors.xml file is loaded, if a legacy monitors.xml file is
      discovered (it has the version number 1), an attempt is made to migrate
      the stored configuration onto the new system.
      This is done in two steps:
      1) Parsing and translation of the old configuration. This works by
      parsing file using the mostly the old parser, but then translating the
      resulting configuration structs into the new configuration system. As
      the legacy configuration system doesn't carry over some state (such as
      tiling and scale used), some things are not available. For tiling, the
      migration paths makes an attempt to discover tiled monitors by
      comparing EDID data, and guessing what the main tile is. Determination
      of the scale of a migrated configuration is postponed until the
      configuration is actually applied. This works by flagging the
      configuration as 'migrated'.
      2) Finishing the migration when applying. When a configuration with the
      'migrated' flag is retrieved from the configuration store, the final
      step of the migration is taken place. This involves calculating the
      preferred scale given the mode configured, while making sure this
      doesn't result in any overlapping logical monitor regions etc.
    • Jonas Ådahl's avatar
      Remove old monitor configuration system · e8a62861
      Jonas Ådahl authored
      Remove the old MetaMonitorConfig system and mark the new one as
      non-experimental. This also removes the D-Bus property.
  17. 19 Jul, 2017 1 commit
    • Rui Matos's avatar
      backends: Add API to switch to predetermined monitor configurations · 3f9c5823
      Rui Matos authored
      This will allows us to support the XF86Display key present on some
      laptops, directly in mutter. This is also known, in evdev, as
      The common usage for this key is to alternate between a few well known
      multi-monitor configurations though these aren't officially
      standardized. As an example, Lenovo documents it as:
      "Switches the display output location between the computer display
      and an external monitor."
      On this patch, we're just introducing the configurations that have been
      implemented in g-s-d until now, which go a bit beyond the above
  18. 14 Jul, 2017 5 commits
  19. 26 May, 2017 1 commit
  20. 17 Apr, 2017 1 commit
  21. 07 Apr, 2017 9 commits