main: Initialise state for actions

Run "deactivate" on all the actions that don't correspond to the initial
selected profile so that non-power-saving get correctly applied if
they're not the default.
This commit is contained in:
Bastien Nocera 2020-07-20 17:01:59 +02:00
parent ab360e4498
commit 5078e578bd

View file

@ -477,6 +477,14 @@ name_acquired_handler (GDBusConnection *connection,
goto bail;
}
/* Set initial state for actions */
for (i = 0; i < NUM_PROFILES; i++) {
if (i == data->active_profile)
continue;
set_all_actions_active (data->actions[i], FALSE);
}
set_all_actions_active (data->actions[data->active_profile], TRUE);
send_dbus_event (data, PROP_ALL);
return;