display: Keep current monitor enabled when forcing an update

In the case where the user plugged/unplugged a screen, we could run into
the case where we would first enable and then disable the same output.
This could potentially result in an invalid configuration.

Prevent this by not disabling the output if no switch happened.
This commit is contained in:
Benjamin Berg 2019-03-07 18:57:05 +01:00 committed by Georges Basile Stavracas Neto
parent 75bf1b8cd1
commit 1f29dad46f

View file

@ -633,7 +633,7 @@ set_current_output (CcDisplayPanel *panel,
{
if (output)
cc_display_monitor_set_active (output, TRUE);
if (panel->current_output)
if (panel->current_output && output != panel->current_output)
cc_display_monitor_set_active (panel->current_output, FALSE);
update_apply_button (panel);