mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-05-19 08:30:22 -07:00
protocols: Don't update hdr metadata if image description is unchanged (#9776)
This commit is contained in:
parent
46b00a4a86
commit
86c279d7d0
@ -332,10 +332,15 @@ const hdr_output_metadata& CColorManagementSurface::hdrMetadata() {
|
||||
|
||||
void CColorManagementSurface::setHDRMetadata(const hdr_output_metadata& metadata) {
|
||||
m_hdrMetadata = metadata;
|
||||
m_lastImageDescription = m_imageDescription;
|
||||
m_needsNewMetadata = false;
|
||||
}
|
||||
|
||||
bool CColorManagementSurface::needsHdrMetadataUpdate() {
|
||||
if (!m_needsNewMetadata)
|
||||
return false;
|
||||
if (m_imageDescription == m_lastImageDescription)
|
||||
m_needsNewMetadata = false;
|
||||
return m_needsNewMetadata;
|
||||
}
|
||||
|
||||
|
@ -65,6 +65,7 @@ class CColorManagementSurface {
|
||||
SP<CWpColorManagementSurfaceV1> m_resource;
|
||||
wl_client* pClient = nullptr;
|
||||
NColorManagement::SImageDescription m_imageDescription;
|
||||
NColorManagement::SImageDescription m_lastImageDescription;
|
||||
bool m_hasImageDescription = false;
|
||||
bool m_needsNewMetadata = false;
|
||||
hdr_output_metadata m_hdrMetadata;
|
||||
|
@ -245,8 +245,8 @@ CXXColorManagementSurface::CXXColorManagementSurface(SP<CXxColorManagementSurfac
|
||||
}
|
||||
|
||||
if (surface.valid()) {
|
||||
surface->colorManagement->setHasImageDescription(true);
|
||||
surface->colorManagement->m_imageDescription = imageDescription->get()->settings;
|
||||
surface->colorManagement->setHasImageDescription(true);
|
||||
} else
|
||||
LOGM(ERR, "Set image description for invalid surface");
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user