Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/common/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ namespace display_device {
}

// ---- Verify fixed header
if (static const std::array fixed_header {std::byte {0x00}, std::byte {0xFF}, std::byte {0xFF}, std::byte {0xFF}, std::byte {0xFF}, std::byte {0xFF}, std::byte {0xFF}, std::byte {0x00}};
!std::equal(std::begin(fixed_header), std::end(fixed_header), std::begin(data))) {
if (static const std::array fixed_header {std::byte {0x00}, std::byte {0xFF}, std::byte {0xFF}, std::byte {0xFF}, std::byte {0xFF}, std::byte {0xFF}, std::byte {0xFF}, std::byte {0x00}}; !std::equal(std::begin(fixed_header), std::end(fixed_header), std::begin(data))) {
DD_LOG(warning) << "EDID data does not contain fixed header.";
return std::nullopt;
}
Expand Down
6 changes: 2 additions & 4 deletions src/windows/settings_manager_apply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,7 @@ namespace display_device {
const bool configuring_primary_devices {config.m_device_id.empty()};
const auto original_display_modes {cached_display_modes.empty() ? current_display_modes : cached_display_modes};

if (const auto new_display_modes {win_utils::computeNewDisplayModes(config.m_resolution, config.m_refresh_rate, configuring_primary_devices, device_to_configure, additional_devices_to_configure, original_display_modes)};
!try_change(new_display_modes, "Changing display modes to:\n", "Failed to apply new configuration, because new display modes could not be set!")) {
if (const auto new_display_modes {win_utils::computeNewDisplayModes(config.m_resolution, config.m_refresh_rate, configuring_primary_devices, device_to_configure, additional_devices_to_configure, original_display_modes)}; !try_change(new_display_modes, "Changing display modes to:\n", "Failed to apply new configuration, because new display modes could not be set!")) {
// Error already logged
return false;
}
Expand Down Expand Up @@ -354,8 +353,7 @@ namespace display_device {
const bool configuring_primary_devices {config.m_device_id.empty()};
const auto original_hdr_states {cached_hdr_states.empty() ? current_hdr_states : cached_hdr_states};

if (const auto new_hdr_states {win_utils::computeNewHdrStates(config.m_hdr_state, configuring_primary_devices, device_to_configure, additional_devices_to_configure, original_hdr_states)};
!try_change(new_hdr_states, "Changing HDR states to:\n", "Failed to apply new configuration, because new HDR states could not be set!")) {
if (const auto new_hdr_states {win_utils::computeNewHdrStates(config.m_hdr_state, configuring_primary_devices, device_to_configure, additional_devices_to_configure, original_hdr_states)}; !try_change(new_hdr_states, "Changing HDR states to:\n", "Failed to apply new configuration, because new HDR states could not be set!")) {
// Error already logged
return false;
}
Expand Down
Loading