mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
monitor-manager-xrandr: Skip outputs with no modes
If we can't find any valid modes for an output we need to unwind and skip the output because trying to use a modeless output later will crash us. https://bugzilla.gnome.org/show_bug.cgi?id=756796
This commit is contained in:
parent
57ae203aab
commit
8b200de35a
@ -661,6 +661,8 @@ output_get_modes (MetaMonitorManager *manager,
|
||||
}
|
||||
}
|
||||
meta_output->n_modes = n_actual_modes;
|
||||
if (n_actual_modes > 0)
|
||||
meta_output->preferred_mode = meta_output->modes[0];
|
||||
}
|
||||
|
||||
static char *
|
||||
@ -825,7 +827,6 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
|
||||
|
||||
output_get_tile_info (manager_xrandr, meta_output);
|
||||
output_get_modes (manager, meta_output, output);
|
||||
meta_output->preferred_mode = meta_output->modes[0];
|
||||
|
||||
meta_output->n_possible_crtcs = output->ncrtc;
|
||||
meta_output->possible_crtcs = g_new0 (MetaCRTC *, meta_output->n_possible_crtcs);
|
||||
@ -873,7 +874,10 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
|
||||
else
|
||||
meta_output->backlight = -1;
|
||||
|
||||
n_actual_outputs++;
|
||||
if (meta_output->n_modes == 0)
|
||||
meta_monitor_manager_clear_output (meta_output);
|
||||
else
|
||||
n_actual_outputs++;
|
||||
}
|
||||
|
||||
XRRFreeOutputInfo (output);
|
||||
|
Loading…
Reference in New Issue
Block a user