[mutter/gnome-3-18] monitor-manager-xrandr: Ignore outputs without modes
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gnome-3-18] monitor-manager-xrandr: Ignore outputs without modes
- Date: Fri, 23 Oct 2015 12:23:41 +0000 (UTC)
commit c9b0d0450312869583e52e26355e51206d356319
Author: Rui Matos <tiagomatos gmail com>
Date: Tue Oct 20 16:01:30 2015 +0200
monitor-manager-xrandr: Ignore outputs without modes
In some cases we get outputs without any valid mode. We need to ignore
them or we'll crash later.
https://bugzilla.gnome.org/show_bug.cgi?id=756796
src/backends/x11/meta-monitor-manager-xrandr.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c
index 0acb217..a555243 100644
--- a/src/backends/x11/meta-monitor-manager-xrandr.c
+++ b/src/backends/x11/meta-monitor-manager-xrandr.c
@@ -808,6 +808,15 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
{
GBytes *edid;
+ /* Get this first so that if there are no valid modes we
+ can immediately skip to the next output without having
+ to unwind all the assignments below. */
+ output_get_modes (manager, meta_output, output);
+ if (meta_output->n_modes == 0)
+ continue;
+
+ meta_output->preferred_mode = meta_output->modes[0];
+
meta_output->winsys_id = resources->outputs[i];
meta_output->name = g_strdup (output->name);
@@ -824,8 +833,6 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
meta_output->connector_type = output_get_connector_type (manager_xrandr, meta_output);
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]