summaryrefslogtreecommitdiff
path: root/src/protocols/ColorManagement.cpp
diff options
context:
space:
mode:
authorUjinT34 <41110182+UjinT34@users.noreply.github.com>2025-07-14 23:54:43 +0300
committerGitHub <noreply@github.com>2025-07-14 22:54:43 +0200
commitbc764f7065c8e46b4e62cbb511b419034712c509 (patch)
tree94286e1de9d71c5676770dd831dc4d23d7f23208 /src/protocols/ColorManagement.cpp
parent06fcdbd9c77c90fc9c3115b646f602a84c53a40e (diff)
protocols: Remove incorrect CM proto debug check and fix preferred image description (#11023)
Diffstat (limited to 'src/protocols/ColorManagement.cpp')
-rw-r--r--src/protocols/ColorManagement.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/protocols/ColorManagement.cpp b/src/protocols/ColorManagement.cpp
index ada121a7..502fbe45 100644
--- a/src/protocols/ColorManagement.cpp
+++ b/src/protocols/ColorManagement.cpp
@@ -362,6 +362,11 @@ CColorManagementFeedbackSurface::CColorManagementFeedbackSurface(SP<CWpColorMana
m_resource->setGetPreferred([this](CWpColorManagementSurfaceFeedbackV1* r, uint32_t id) {
LOGM(TRACE, "Get preferred for id {}", id);
+ if (m_surface.expired()) {
+ r->error(WP_COLOR_MANAGEMENT_SURFACE_FEEDBACK_V1_ERROR_INERT, "Surface is inert");
+ return;
+ }
+
if (m_currentPreferred.valid())
PROTO::colorManagement->destroyResource(m_currentPreferred.get());
@@ -377,15 +382,15 @@ CColorManagementFeedbackSurface::CColorManagementFeedbackSurface(SP<CWpColorMana
RESOURCE->m_self = RESOURCE;
m_currentPreferred = RESOURCE;
- m_currentPreferred->m_settings = g_pCompositor->getPreferredImageDescription();
+ m_currentPreferred->m_settings = m_surface->getPreferredImageDescription();
RESOURCE->resource()->sendReady(m_currentPreferred->m_settings.updateId());
});
m_resource->setGetPreferredParametric([this](CWpColorManagementSurfaceFeedbackV1* r, uint32_t id) {
LOGM(TRACE, "Get preferred for id {}", id);
- if (!PROTO::colorManagement->m_debug) {
- r->error(WP_COLOR_MANAGER_V1_ERROR_UNSUPPORTED_FEATURE, "Parametric descriptions are not supported");
+ if (m_surface.expired()) {
+ r->error(WP_COLOR_MANAGEMENT_SURFACE_FEEDBACK_V1_ERROR_INERT, "Surface is inert");
return;
}
@@ -404,7 +409,7 @@ CColorManagementFeedbackSurface::CColorManagementFeedbackSurface(SP<CWpColorMana
RESOURCE->m_self = RESOURCE;
m_currentPreferred = RESOURCE;
- m_currentPreferred->m_settings = g_pCompositor->getPreferredImageDescription();
+ m_currentPreferred->m_settings = m_surface->getPreferredImageDescription();
if (!PROTO::colorManagement->m_debug && m_currentPreferred->m_settings.icc.fd) {
LOGM(ERR, "FIXME: parse icc profile");
r->error(WP_COLOR_MANAGER_V1_ERROR_UNSUPPORTED_FEATURE, "ICC profiles are not supported");