mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 02:40:08 +00:00
sculpt: refine condition of acpi features
Commit "sculpt: safeguard the offering of suspend/resume" was too lax about the detection of acpi support. In situations where acpi support is selected but not yet installed, the menu would offer the features already. This patch restricts the condition such that acpi support must be running, not merely selected. Issue #5174
This commit is contained in:
parent
ad722f1450
commit
39ccd5ab79
@ -2201,7 +2201,7 @@ void Sculpt::Main::_handle_runtime_state(Xml_node const &state)
|
||||
|
||||
/* power-management features depend on optional acpi_support subsystem */
|
||||
{
|
||||
bool const acpi_support = _runtime_state.present_in_runtime("acpi_support");
|
||||
bool const acpi_support = _cached_runtime_config.present_in_runtime("acpi_support");
|
||||
Power_features const orig_power_features = _power_features;
|
||||
_power_features.poweroff = acpi_support;
|
||||
_power_features.suspend = acpi_support && _drivers.suspend_supported();;
|
||||
|
@ -382,6 +382,15 @@ class Sculpt::Runtime_config
|
||||
);
|
||||
}
|
||||
|
||||
bool present_in_runtime(Start_name const &name) const
|
||||
{
|
||||
bool result = false;
|
||||
_components.for_each([&] (Component const &component) {
|
||||
if (component.name == name)
|
||||
result = true; });
|
||||
return result;
|
||||
}
|
||||
|
||||
void with_start_name(Dialog::Id const &id, auto const &fn) const
|
||||
{
|
||||
_components.for_each([&] (Component const &component) {
|
||||
|
Loading…
Reference in New Issue
Block a user