[mutter] monitor-manager-xrandr: Skip outputs with no modes
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] monitor-manager-xrandr: Skip outputs with no modes
- Date: Fri, 30 Oct 2015 17:16:45 +0000 (UTC)
commit 8b200de35ab084a8d61eaa10e2c23bda531a6557
Author: Rui Matos <tiagomatos gmail com>
Date: Tue Oct 27 15:24:58 2015 +0100
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
src/backends/x11/meta-monitor-manager-xrandr.c | 8 ++++++--
1 files changed, 6 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..f7e695d 100644
--- a/src/backends/x11/meta-monitor-manager-xrandr.c
+++ b/src/backends/x11/meta-monitor-manager-xrandr.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]