Changeset View
Changeset View
Standalone View
Standalone View
src/server/surface_interface.cpp
Show First 20 Lines • Show All 337 Lines • ▼ Show 20 Line(s) | 337 | if (transformChanged) { | |||
---|---|---|---|---|---|
338 | emit q->transformChanged(target->transform); | 338 | emit q->transformChanged(target->transform); | ||
339 | } | 339 | } | ||
340 | if (bufferChanged && emitChanged) { | 340 | if (bufferChanged && emitChanged) { | ||
341 | if (!target->damage.isEmpty()) { | 341 | if (!target->damage.isEmpty()) { | ||
342 | const QRegion windowRegion = QRegion(0, 0, q->size().width(), q->size().height()); | 342 | const QRegion windowRegion = QRegion(0, 0, q->size().width(), q->size().height()); | ||
343 | if (!windowRegion.isEmpty()) { | 343 | if (!windowRegion.isEmpty()) { | ||
344 | target->damage = windowRegion.intersected(target->damage); | 344 | target->damage = windowRegion.intersected(target->damage); | ||
345 | if (emitChanged) { | 345 | if (emitChanged) { | ||
346 | subSurfaceIsMapped = true; | ||||
346 | emit q->damaged(target->damage); | 347 | emit q->damaged(target->damage); | ||
347 | // workaround for https://bugreports.qt.io/browse/QTBUG-52092 | 348 | // workaround for https://bugreports.qt.io/browse/QTBUG-52092 | ||
348 | // if the surface is a sub-surface, but the main surface is not yet mapped, fake frame rendered | 349 | // if the surface is a sub-surface, but the main surface is not yet mapped, fake frame rendered | ||
349 | if (subSurface && !subSurface->mainSurface()->buffer()) { | 350 | if (subSurface && !subSurface->mainSurface()->buffer()) { | ||
350 | q->frameRendered(0); | 351 | q->frameRendered(0); | ||
351 | } | 352 | } | ||
352 | } | 353 | } | ||
353 | } | 354 | } | ||
354 | } else if (!target->buffer && emitChanged) { | 355 | } else if (!target->buffer && emitChanged) { | ||
356 | subSurfaceIsMapped = false; | ||||
355 | emit q->unmapped(); | 357 | emit q->unmapped(); | ||
356 | } | 358 | } | ||
357 | } | 359 | } | ||
358 | if (!emitChanged) { | 360 | if (!emitChanged) { | ||
359 | return; | 361 | return; | ||
360 | } | 362 | } | ||
361 | if (sizeChanged) { | 363 | if (sizeChanged) { | ||
362 | emit q->sizeChanged(); | 364 | emit q->sizeChanged(); | ||
▲ Show 20 Lines • Show All 304 Lines • ▼ Show 20 Line(s) | |||||
667 | } | 669 | } | ||
668 | 670 | | |||
669 | bool SurfaceInterface::isMapped() const | 671 | bool SurfaceInterface::isMapped() const | ||
670 | { | 672 | { | ||
671 | Q_D(); | 673 | Q_D(); | ||
672 | if (d->subSurface) { | 674 | if (d->subSurface) { | ||
673 | // from spec: | 675 | // from spec: | ||
674 | // "A sub-surface becomes mapped, when a non-NULL wl_buffer is applied and the parent surface is mapped." | 676 | // "A sub-surface becomes mapped, when a non-NULL wl_buffer is applied and the parent surface is mapped." | ||
675 | return d->current.buffer && !d->subSurface->parentSurface().isNull() && d->subSurface->parentSurface()->isMapped(); | 677 | return d->subSurfaceIsMapped && !d->subSurface->parentSurface().isNull() && d->subSurface->parentSurface()->isMapped(); | ||
676 | } | 678 | } | ||
677 | return d->current.buffer != nullptr; | 679 | return d->current.buffer != nullptr; | ||
678 | } | 680 | } | ||
679 | 681 | | |||
680 | SurfaceInterface::Private *SurfaceInterface::d_func() const | 682 | SurfaceInterface::Private *SurfaceInterface::d_func() const | ||
681 | { | 683 | { | ||
682 | return reinterpret_cast<Private*>(d.data()); | 684 | return reinterpret_cast<Private*>(d.data()); | ||
683 | } | 685 | } | ||
684 | 686 | | |||
685 | } | 687 | } | ||
686 | } | 688 | } |