diff --git a/tuned/ppd/controller.py b/tuned/ppd/controller.py index 6be798d..5cc7b6d 100644 --- a/tuned/ppd/controller.py +++ b/tuned/ppd/controller.py @@ -249,7 +249,9 @@ class Controller(exports.interfaces.ExportableInterface): """ if not result: return - self._profile_holds.clear() + if tuned_profile != self._tuned_interface.active_profile(): + log.debug("Received a profile change signal from TuneD, but it is not relevant anymore.") + return try: ppd_profile = self._config.tuned_to_ppd.get(tuned_profile, self._on_battery) except KeyError: @@ -257,6 +259,7 @@ class Controller(exports.interfaces.ExportableInterface): log.warning("TuneD profile changed to an unknown profile '%s'" % tuned_profile) if self._active_profile != ppd_profile: log.info("Profile changed to '%s'" % ppd_profile) + self._profile_holds.clear() self._active_profile = ppd_profile exports.property_changed("ActiveProfile", self._active_profile) if ppd_profile != UNKNOWN_PROFILE: