mirror of
https://gitlab.freedesktop.org/upower/power-profiles-daemon.git
synced 2026-05-07 07:18:01 +02:00
main: Fix transitions if one profile is inhibited
When transitioning from one profile to another, we only want to stop the active profile from changing if the target profile is inhibited, which it might not be if we want to switch to, say, the power-saver profile. This was broken since drivers could handle more than one profile.
This commit is contained in:
parent
f65f3cddd5
commit
a92150c2b7
1 changed files with 4 additions and 3 deletions
|
|
@ -247,13 +247,14 @@ set_selected_profile (PpdApp *data,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
g_debug ("Transitioning from '%s' to '%s'",
|
||||
g_debug ("Transitioning selected profile from '%s' to '%s'",
|
||||
ppd_profile_to_str (data->selected_profile), profile);
|
||||
data->selected_profile = target_profile;
|
||||
|
||||
if (ppd_driver_is_inhibited (SELECTED_DRIVER)) {
|
||||
if (target_profile == PPD_PROFILE_PERFORMANCE &&
|
||||
ppd_driver_is_inhibited (SELECTED_DRIVER)) {
|
||||
send_dbus_event (data, PROP_SELECTED_PROFILE);
|
||||
g_debug ("Not transitioning to '%s' as inhibited", profile);
|
||||
g_debug ("Not transitioning active profile to '%s' as inhibited", profile);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue