Skip to content
  • 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
    active).
    
    Fixes: #281
    !213
    6267732b