protocols: Remove incorrect CM proto debug check and fix preferred image description (#11023)

This commit is contained in:
UjinT34 2025-07-14 23:54:43 +03:00 committed by GitHub
parent 06fcdbd9c7
commit bc764f7065
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 4 deletions

View file

@ -1,4 +1,5 @@
#include "Compositor.hpp"
#include "../../Compositor.hpp"
#include "Output.hpp"
#include "Seat.hpp"
#include "../types/WLBuffer.hpp"
@ -17,6 +18,8 @@
#include "render/Texture.hpp"
#include <cstring>
using namespace NColorManagement;
class CDefaultSurfaceRole : public ISurfaceRole {
public:
virtual eSurfaceRole role() {
@ -535,6 +538,10 @@ void CWLSurfaceResource::commitState(SSurfaceState& state) {
dropCurrentBuffer();
}
SImageDescription CWLSurfaceResource::getPreferredImageDescription() {
return m_enteredOutputs.size() == 1 ? m_enteredOutputs[0]->m_imageDescription : g_pCompositor->getPreferredImageDescription();
}
void CWLSurfaceResource::updateCursorShm(CRegion damage) {
if (damage.empty())
return;

View file

@ -18,6 +18,7 @@
#include "../../helpers/math/Math.hpp"
#include "../../helpers/time/Time.hpp"
#include "../types/Buffer.hpp"
#include "../types/ColorManagement.hpp"
#include "../types/SurfaceRole.hpp"
#include "../types/SurfaceState.hpp"
@ -107,6 +108,7 @@ class CWLSurfaceResource {
SP<CWLSurfaceResource> findFirstPreorder(std::function<bool(SP<CWLSurfaceResource>)> fn);
void presentFeedback(const Time::steady_tp& when, PHLMONITOR pMonitor, bool discarded = false);
void commitState(SSurfaceState& state);
NColorManagement::SImageDescription getPreferredImageDescription();
// returns a pair: found surface (null if not found) and surface local coords.
// localCoords param is relative to 0,0 of this surface