Commit b4cd89ea authored by David Edmundson's avatar David Edmundson
Browse files

Don't silently error if damage is sent before buffer

Firefox sends

wl_surface@37.damage(0, 0, 808, 622)
wl_surface@37.attach(wl_buffer@34, 0, 0)

Which we silently treat as an error.

There's nothing in the spec to forbid this. The only thing that matters
is the state on commit. This moves a check there.

CCBUG: 397834

Test Plan:
Had a debug in there which was being activated
Gets firefox slightly further (but not complete)

Reviewers: #kwin

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision:
parent 66101a89
......@@ -439,7 +439,7 @@ void SurfaceInterface::Private::swapStates(State *source, State *target, bool em
emit q->transformChanged(target->transform);
if (bufferChanged && emitChanged) {
if (!target->damage.isEmpty()) {
if (target->buffer && !target->damage.isEmpty()) {
const QRegion windowRegion = QRegion(0, 0, q->size().width(), q->size().height());
if (!windowRegion.isEmpty()) {
target->damage = windowRegion.intersected(target->damage);
......@@ -524,10 +524,6 @@ void SurfaceInterface::Private::commitSubSurface()
void SurfaceInterface::Private::damage(const QRect &rect)
if (!pending.bufferIsSet || (pending.bufferIsSet && !pending.buffer)) {
// TODO: should we send an error?
pending.damage = pending.damage.united(rect);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment