mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 03:20:46 -05:00
MetaMonitorConfig: don't keep a previous config with the wrong outputs
We can only apply a configuration if its outputs match the connected ones, so discard the current configuration if the set of output changes (for example for hotplug), otherwise we will crash trying to apply the bogus previous configuration. https://bugzilla.gnome.org/show_bug.cgi?id=725637
This commit is contained in:
parent
49952bdc69
commit
b4de2458ab
@ -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))
|
||||
@ -886,9 +887,21 @@ apply_configuration (MetaMonitorConfig *self,
|
||||
self->previous = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 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;
|
||||
self->current_is_stored = stored;
|
||||
|
Loading…
Reference in New Issue
Block a user