Commit 325ed5fb authored by Alberts Muktupāvels's avatar Alberts Muktupāvels
Browse files

monitor-config-manager: fallback to closed laptop lid configuration

Based on mutter commit:
parent 92287e49
Pipeline #174588 passed with stages
in 30 minutes and 22 seconds
......@@ -866,23 +866,35 @@ GfMonitorsConfigKey *
gf_create_monitors_config_key_for_current_state (GfMonitorManager *monitor_manager)
GfMonitorsConfigKey *config_key;
GfMonitorSpec *laptop_monitor_spec;
GList *l;
GList *monitor_specs;
laptop_monitor_spec = NULL;
monitor_specs = NULL;
for (l = monitor_manager->monitors; l; l = l->next)
GfMonitor *monitor = l->data;
GfMonitorSpec *monitor_spec;
if (gf_monitor_is_laptop_panel (monitor) &&
gf_monitor_manager_is_lid_closed (monitor_manager))
if (gf_monitor_is_laptop_panel (monitor))
laptop_monitor_spec = gf_monitor_get_spec (monitor);
if (gf_monitor_manager_is_lid_closed (monitor_manager))
monitor_spec = gf_monitor_spec_clone (gf_monitor_get_spec (monitor));
monitor_specs = g_list_prepend (monitor_specs, monitor_spec);
if (!monitor_specs && laptop_monitor_spec)
monitor_specs =
g_list_prepend (NULL, gf_monitor_spec_clone (laptop_monitor_spec));
if (!monitor_specs)
return NULL;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment