diff options
| author | Tom Englund <tomenglund26@gmail.com> | 2025-07-07 16:18:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-07 16:18:06 +0200 |
| commit | 54369adffa1d7fba01e523125a420b04154dc5f7 (patch) | |
| tree | a6b80f61470082e6898fa2a7dda66277d0c064f6 /src/protocols/core/Compositor.cpp | |
| parent | d23ed852fc6942d28f78006b01c9a853f8ff194e (diff) | |
internal: iso C++ prohibits anonymous structs (#10955)
turn on -Wpedantic and name the anonymous struct.
Diffstat (limited to 'src/protocols/core/Compositor.cpp')
| -rw-r--r-- | src/protocols/core/Compositor.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/protocols/core/Compositor.cpp b/src/protocols/core/Compositor.cpp index d1efe2e8..371da093 100644 --- a/src/protocols/core/Compositor.cpp +++ b/src/protocols/core/Compositor.cpp @@ -72,8 +72,8 @@ CWLSurfaceResource::CWLSurfaceResource(SP<CWlSurface> resource_) : m_resource(re m_resource->setOnDestroy([this](CWlSurface* r) { destroy(); }); m_resource->setAttach([this](CWlSurface* r, wl_resource* buffer, int32_t x, int32_t y) { - m_pending.updated.buffer = true; - m_pending.updated.offset = true; + m_pending.updated.bits.buffer = true; + m_pending.updated.bits.offset = true; m_pending.offset = {x, y}; @@ -95,8 +95,8 @@ CWLSurfaceResource::CWLSurfaceResource(SP<CWlSurface> resource_) : m_resource(re } if (m_pending.bufferSize != m_current.bufferSize) { - m_pending.updated.damage = true; - m_pending.bufferDamage = CBox{{}, {INT32_MAX, INT32_MAX}}; + m_pending.updated.bits.damage = true; + m_pending.bufferDamage = CBox{{}, {INT32_MAX, INT32_MAX}}; } }); @@ -124,7 +124,7 @@ CWLSurfaceResource::CWLSurfaceResource(SP<CWlSurface> resource_) : m_resource(re return; } - if ((!m_pending.updated.buffer) || // no new buffer attached + if ((!m_pending.updated.bits.buffer) || // no new buffer attached (!m_pending.buffer && !m_pending.texture) // null buffer attached ) { commitState(m_pending); @@ -149,7 +149,7 @@ CWLSurfaceResource::CWLSurfaceResource(SP<CWlSurface> resource_) : m_resource(re m_pendingStates.pop(); }; - if (state->updated.acquire) { + if (state->updated.bits.acquire) { // wait on acquire point for this surface, from explicit sync protocol state->acquire.addWaiter(whenReadable); } else if (state->buffer->isSynchronous()) { @@ -170,11 +170,11 @@ CWLSurfaceResource::CWLSurfaceResource(SP<CWlSurface> resource_) : m_resource(re }); m_resource->setDamage([this](CWlSurface* r, int32_t x, int32_t y, int32_t w, int32_t h) { - m_pending.updated.damage = true; + m_pending.updated.bits.damage = true; m_pending.damage.add(CBox{x, y, w, h}); }); m_resource->setDamageBuffer([this](CWlSurface* r, int32_t x, int32_t y, int32_t w, int32_t h) { - m_pending.updated.damage = true; + m_pending.updated.bits.damage = true; m_pending.bufferDamage.add(CBox{x, y, w, h}); }); @@ -182,8 +182,8 @@ CWLSurfaceResource::CWLSurfaceResource(SP<CWlSurface> resource_) : m_resource(re if (scale == m_pending.scale) return; - m_pending.updated.scale = true; - m_pending.updated.damage = true; + m_pending.updated.bits.scale = true; + m_pending.updated.bits.damage = true; m_pending.scale = scale; m_pending.bufferDamage = CBox{{}, {INT32_MAX, INT32_MAX}}; @@ -193,15 +193,15 @@ CWLSurfaceResource::CWLSurfaceResource(SP<CWlSurface> resource_) : m_resource(re if (tr == m_pending.transform) return; - m_pending.updated.transform = true; - m_pending.updated.damage = true; + m_pending.updated.bits.transform = true; + m_pending.updated.bits.damage = true; m_pending.transform = (wl_output_transform)tr; m_pending.bufferDamage = CBox{{}, {INT32_MAX, INT32_MAX}}; }); m_resource->setSetInputRegion([this](CWlSurface* r, wl_resource* region) { - m_pending.updated.input = true; + m_pending.updated.bits.input = true; if (!region) { m_pending.input = CBox{{}, {INT32_MAX, INT32_MAX}}; @@ -213,7 +213,7 @@ CWLSurfaceResource::CWLSurfaceResource(SP<CWlSurface> resource_) : m_resource(re }); m_resource->setSetOpaqueRegion([this](CWlSurface* r, wl_resource* region) { - m_pending.updated.opaque = true; + m_pending.updated.bits.opaque = true; if (!region) { m_pending.opaque = CBox{{}, {}}; @@ -227,8 +227,8 @@ CWLSurfaceResource::CWLSurfaceResource(SP<CWlSurface> resource_) : m_resource(re m_resource->setFrame([this](CWlSurface* r, uint32_t id) { m_callbacks.emplace_back(makeShared<CWLCallbackResource>(makeShared<CWlCallback>(m_client, 1, id))); }); m_resource->setOffset([this](CWlSurface* r, int32_t x, int32_t y) { - m_pending.updated.offset = true; - m_pending.offset = {x, y}; + m_pending.updated.bits.offset = true; + m_pending.offset = {x, y}; }); } |
