Skip to content
  • Marco Trevisan's avatar
    monitor-config-manager: Fallback to closed laptop lid configuration · e4851667
    Marco Trevisan authored and Marco Trevisan's avatar Marco Trevisan committed
    When closing the lid of a laptop, we reconfigure all the monitors in order
    to update the CRTCs and (if enabled) the global UI scaling factor.
    
    To do this, we try first to reuse the current configuration for the usable
    monitors, but if we have only monitor enabled and this one is on the laptop
    lid we just end up creating a new configuration where the primary monitor is
    the laptop one (as per find_primary_monitor() in MetaMonitorConfigManager),
    but ignoring the user parameters.
    
    In case the user selected a different resolution / scaling compared to the
    default one, while the laptop lid is closed we might change the monitors
    layout, causing applications to rescale or reposition.
    
    To avoid this, when creating the monitors configuration from the current
    current state, in case we have only one monitor available and that one is
    the laptop panel, let's just reuse this configuration.
    
    !1200
    e4851667