monitor-manager: Don't notify unchanged power save mode

Since 4cae9b5b11, and indirectly before that as well, the
MetaMonitorManager::power-save-mode-changed is emitted even
when the power save mode didn't actually change.

On Wayland, this causes a mode set and therefore a stuttering.
It became more proeminent with the transactional KMS code.

Only emit 'power-save-mode-changed' when the power save mode
actually changed.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/674
This commit is contained in:
Georges Basile Stavracas Neto 2019-07-06 20:23:57 -03:00
parent 1f133b3ed2
commit 4a184d74d5
No known key found for this signature in database
GPG Key ID: 886C17EE170D1385

View File

@ -345,6 +345,9 @@ meta_monitor_manager_power_save_mode_changed (MetaMonitorManager *manager,
MetaMonitorManagerPrivate *priv =
meta_monitor_manager_get_instance_private (manager);
if (priv->power_save_mode == mode)
return;
priv->power_save_mode = mode;
g_signal_emit (manager, signals[POWER_SAVE_MODE_CHANGED], 0);
}