monitor-manager: Check active monitors when looking for logical monitor

An inactive monitor will not be assigned to a logical monitor, so don't
try to match against those. This avoids a dereferencing a NULL when the
main output of an inactive monitor doesn't have an assigned CRTC.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit is contained in:
Jonas Ådahl 2017-04-07 23:41:23 +08:00
parent e6eac46629
commit c214eb15bf

View File

@ -2950,7 +2950,8 @@ meta_monitor_manager_get_monitor_for_connector (MetaMonitorManager *manager,
{
MetaMonitor *monitor = l->data;
if (g_str_equal (connector, meta_monitor_get_connector (monitor)))
if (meta_monitor_is_active (monitor) &&
g_str_equal (connector, meta_monitor_get_connector (monitor)))
{
MetaOutput *main_output = meta_monitor_get_main_output (monitor);