summaryrefslogtreecommitdiff
path: root/src/protocols/core/Compositor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocols/core/Compositor.cpp')
-rw-r--r--src/protocols/core/Compositor.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/protocols/core/Compositor.cpp b/src/protocols/core/Compositor.cpp
index 974207a4..cb1aa69a 100644
--- a/src/protocols/core/Compositor.cpp
+++ b/src/protocols/core/Compositor.cpp
@@ -77,6 +77,7 @@ CWLSurfaceResource::CWLSurfaceResource(SP<CWlSurface> resource_) : resource(reso
if (!buffer) {
pending.buffer.reset();
pending.texture.reset();
+ pending.bufferSize = Vector2D{};
} else {
auto res = CWLBufferResource::fromResource(buffer);
pending.buffer = res && res->buffer ? makeShared<CHLBufferReference>(res->buffer.lock(), self.lock()) : nullptr;
@@ -85,10 +86,7 @@ CWLSurfaceResource::CWLSurfaceResource(SP<CWlSurface> resource_) : resource(reso
pending.bufferSize = res && res->buffer ? res->buffer->size : Vector2D{};
}
- Vector2D oldBufSize = current.buffer ? current.bufferSize : Vector2D{};
- Vector2D newBufSize = pending.buffer ? pending.bufferSize : Vector2D{};
-
- if (oldBufSize != newBufSize || current.buffer != pending.buffer)
+ if (pending.bufferSize != current.bufferSize)
pending.bufferDamage = CBox{{}, {INT32_MAX, INT32_MAX}};
});
@@ -129,12 +127,18 @@ CWLSurfaceResource::CWLSurfaceResource(SP<CWlSurface> resource_) : resource(reso
});
resource->setSetBufferScale([this](CWlSurface* r, int32_t scale) {
- pending.updated |= SSurfaceState::eUpdatedProperties::SURFACE_UPDATED_SCALE;
- pending.scale = scale;
+ if (scale == pending.scale)
+ return;
+ pending.updated |= SSurfaceState::eUpdatedProperties::SURFACE_UPDATED_SCALE | SSurfaceState::eUpdatedProperties::SURFACE_UPDATED_DAMAGE;
+ pending.scale = scale;
+ pending.bufferDamage = CBox{{}, {INT32_MAX, INT32_MAX}};
});
resource->setSetBufferTransform([this](CWlSurface* r, uint32_t tr) {
- pending.updated |= SSurfaceState::eUpdatedProperties::SURFACE_UPDATED_TRANSFORM;
- pending.transform = (wl_output_transform)tr;
+ if (tr == pending.transform)
+ return;
+ pending.updated |= SSurfaceState::eUpdatedProperties::SURFACE_UPDATED_TRANSFORM | SSurfaceState::eUpdatedProperties::SURFACE_UPDATED_DAMAGE;
+ pending.transform = (wl_output_transform)tr;
+ pending.bufferDamage = CBox{{}, {INT32_MAX, INT32_MAX}};
});
resource->setSetInputRegion([this](CWlSurface* r, wl_resource* region) {