diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c index 9a15c31d0..e3595fcd1 100644 --- a/src/backends/meta-monitor.c +++ b/src/backends/meta-monitor.c @@ -1594,6 +1594,32 @@ meta_monitor_mode_foreach_crtc (MetaMonitor *monitor, GList *l; int i; + for (l = monitor_priv->outputs, i = 0; l; l = l->next, i++) + { + MetaMonitorCrtcMode *monitor_crtc_mode = &mode->crtc_modes[i]; + + if (!monitor_crtc_mode->crtc_mode) + continue; + + if (!func (monitor, mode, monitor_crtc_mode, user_data, error)) + return FALSE; + } + + return TRUE; +} + +gboolean +meta_monitor_mode_foreach_output (MetaMonitor *monitor, + MetaMonitorMode *mode, + MetaMonitorModeFunc func, + gpointer user_data, + GError **error) +{ + MetaMonitorPrivate *monitor_priv = + meta_monitor_get_instance_private (monitor); + GList *l; + int i; + for (l = monitor_priv->outputs, i = 0; l; l = l->next, i++) { MetaMonitorCrtcMode *monitor_crtc_mode = &mode->crtc_modes[i]; diff --git a/src/backends/meta-monitor.h b/src/backends/meta-monitor.h index 6ca93cd57..f4260d61f 100644 --- a/src/backends/meta-monitor.h +++ b/src/backends/meta-monitor.h @@ -197,6 +197,12 @@ gboolean meta_monitor_mode_foreach_crtc (MetaMonitor *monitor, gpointer user_data, GError **error); +gboolean meta_monitor_mode_foreach_output (MetaMonitor *monitor, + MetaMonitorMode *mode, + MetaMonitorModeFunc func, + gpointer user_data, + GError **error); + MetaMonitorSpec * meta_monitor_spec_clone (MetaMonitorSpec *monitor_id); gboolean meta_monitor_spec_equals (MetaMonitorSpec *monitor_id, diff --git a/src/tests/monitor-unit-tests.c b/src/tests/monitor-unit-tests.c index e2dcdc59c..ddf017cd0 100644 --- a/src/tests/monitor-unit-tests.c +++ b/src/tests/monitor-unit-tests.c @@ -659,10 +659,10 @@ check_monitor_configuration (MonitorTestCase *test_case) .expect_crtc_mode_iter = test_case->expect.monitors[i].modes[j].crtc_modes }; - meta_monitor_mode_foreach_crtc (monitor, mode, - check_monitor_mode, - &data, - NULL); + meta_monitor_mode_foreach_output (monitor, mode, + check_monitor_mode, + &data, + NULL); } current_mode = meta_monitor_get_current_mode (monitor); @@ -688,10 +688,10 @@ check_monitor_configuration (MonitorTestCase *test_case) .expect_crtc_mode_iter = test_case->expect.monitors[i].modes[expected_current_mode_index].crtc_modes }; - meta_monitor_mode_foreach_crtc (monitor, expected_current_mode, - check_current_monitor_mode, - &data, - NULL); + meta_monitor_mode_foreach_output (monitor, expected_current_mode, + check_current_monitor_mode, + &data, + NULL); } meta_monitor_derive_current_mode (monitor);