diff options
author | Giovanni Campagna <gcampagna@src.gnome.org> | 2013-10-15 20:12:05 +0200 |
---|---|---|
committer | Adel Gadllah <adel.gadllah@gmail.com> | 2013-10-15 23:22:05 +0200 |
commit | b86a289ee3e989697712ecf13832e2c886a07e89 (patch) | |
tree | b9898d3ad9c45423032b4ae9345e1b2ba6cde9d3 | |
parent | badebfae6b7bc890bca1aa5e42357041e570cb23 (diff) |
monitor-config: prevent assert that at least one output is connected
Apparently some connector technologies don't distinguish between
on and off, and there might be valid use cases for running without
any connected monitor.
In that case, just avoid any configuration at all.
https://bugzilla.gnome.org/show_bug.cgi?id=709009
-rw-r--r-- | src/core/monitor-config.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/monitor-config.c b/src/core/monitor-config.c index 8fcd4960..82ea0b1a 100644 --- a/src/core/monitor-config.c +++ b/src/core/monitor-config.c @@ -824,6 +824,9 @@ meta_monitor_config_get_stored (MetaMonitorConfig *self, MetaConfiguration key; MetaConfiguration *stored; + if (n_outputs == 0) + return NULL; + make_config_key (&key, outputs, n_outputs, -1); stored = g_hash_table_lookup (self->configs, &key); @@ -1231,6 +1234,12 @@ meta_monitor_config_make_default (MetaMonitorConfig *self, outputs = meta_monitor_manager_get_outputs (manager, &n_outputs); meta_monitor_manager_get_screen_limits (manager, &max_width, &max_height); + if (n_outputs == 0) + { + meta_verbose ("No output connected, not applying configuration\n"); + return; + } + default_config = make_default_config (self, outputs, n_outputs, max_width, max_height); if (default_config != NULL) |