diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c index 5bd34ad47..c4c1db5ed 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -1323,9 +1323,13 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton, GVariantBuilder mode_properties_builder; MetaCrtcModeFlag mode_flags; + if (!meta_monitor_mode_should_be_advertised (monitor_mode)) + continue; + mode_id = meta_monitor_mode_get_id (monitor_mode); meta_monitor_mode_get_resolution (monitor_mode, &mode_width, &mode_height); + refresh_rate = meta_monitor_mode_get_refresh_rate (monitor_mode); preferred_scale = diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c index 98330661e..92c61c037 100644 --- a/src/backends/meta-monitor.c +++ b/src/backends/meta-monitor.c @@ -1553,6 +1553,22 @@ meta_monitor_calculate_mode_scale (MetaMonitor *monitor, return calculate_scale (monitor, monitor_mode); } +static gboolean +is_logical_size_large_enough (gint width, gint height) +{ + return width >= MINIMUM_LOGICAL_WIDTH && + height >= MINIMUM_LOGICAL_HEIGHT; +} + +gboolean +meta_monitor_mode_should_be_advertised (MetaMonitorMode *monitor_mode) +{ + g_return_val_if_fail (monitor_mode != NULL, FALSE); + + return is_logical_size_large_enough (monitor_mode->spec.width, + monitor_mode->spec.height); +} + static float get_closest_scale_factor_for_resolution (float width, float height, @@ -1573,8 +1589,7 @@ get_closest_scale_factor_for_resolution (float width, if (scale < MINIMUM_SCALE_FACTOR || scale > MAXIMUM_SCALE_FACTOR || - floorf (scaled_w) < MINIMUM_LOGICAL_WIDTH || - floorf (scaled_h) < MINIMUM_LOGICAL_HEIGHT) + !is_logical_size_large_enough (floorf (scaled_w), floorf (scaled_h))) goto out; if (floorf (scaled_w) == scaled_w && floorf (scaled_h) == scaled_h) diff --git a/src/backends/meta-monitor.h b/src/backends/meta-monitor.h index bc7977886..213ff2cbb 100644 --- a/src/backends/meta-monitor.h +++ b/src/backends/meta-monitor.h @@ -219,6 +219,8 @@ gboolean meta_monitor_mode_foreach_output (MetaMonitor *monitor, gpointer user_data, GError **error); +gboolean meta_monitor_mode_should_be_advertised (MetaMonitorMode *monitor_mode); + MetaMonitorSpec * meta_monitor_spec_clone (MetaMonitorSpec *monitor_id); gboolean meta_monitor_spec_equals (MetaMonitorSpec *monitor_id,