Commit 37c768ab authored by Benjamin Berg's avatar Benjamin Berg Committed by Georges Basile Stavracas Neto

display: Fix Apply button showing for changes to disabled monitor

Disabled monitors may or may not have a mode selected. This means, we
need to skip the mode comparison if the two compared monitors are
disabled (i.e. have no logical monitor).
Move the mode check to the end and skip it if both monitors are disabled.

This fixes cases where identical configurations are misdetected, because
we applied a mode to a monitor and disabled the monitor again. This
happens for example when switching the active monitor in "single" mode.
parent 1f29dad4
......@@ -1066,11 +1066,15 @@ cc_display_config_dbus_equal (CcDisplayConfig *pself,
if (m1->underscanning != m2->underscanning)
return FALSE;
if (!cc_display_mode_dbus_equal (CC_DISPLAY_MODE_DBUS (m1->current_mode),
CC_DISPLAY_MODE_DBUS (m2->current_mode)))
if (!cc_display_logical_monitor_equal (m1->logical_monitor, m2->logical_monitor))
return FALSE;
if (!cc_display_logical_monitor_equal (m1->logical_monitor, m2->logical_monitor))
/* Modes should not be compared if both monitors have no logical monitor. */
if (m1->logical_monitor == NULL && m2->logical_monitor == NULL)
continue;
if (!cc_display_mode_dbus_equal (CC_DISPLAY_MODE_DBUS (m1->current_mode),
CC_DISPLAY_MODE_DBUS (m2->current_mode)))
return FALSE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment