diff --git a/src/core/monitor-config.c b/src/core/monitor-config.c index a7e4ed546..0cf0866e8 100644 --- a/src/core/monitor-config.c +++ b/src/core/monitor-config.c @@ -876,7 +876,8 @@ apply_configuration (MetaMonitorConfig *self, /* Stored (persistent) configurations override the previous one always. Also, we clear the previous configuration if the current one (which is - about to become previous) is stored. + about to become previous) is stored, or if the current one has + different outputs. */ if (stored || (self->current && self->current_is_stored)) @@ -887,7 +888,19 @@ apply_configuration (MetaMonitorConfig *self, } else { - self->previous = self->current; + /* Despite the name, config_equal() only checks the set of outputs, + not their modes + */ + if (self->current && config_equal (self->current, config)) + { + self->previous = self->current; + } + else + { + if (self->current) + config_free (self->current); + self->previous = NULL; + } } self->current = config;