diff options
Diffstat (limited to 'src/compositor/compositor_api/qwaylandsurfaceitem.cpp')
-rw-r--r-- | src/compositor/compositor_api/qwaylandsurfaceitem.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/compositor/compositor_api/qwaylandsurfaceitem.cpp b/src/compositor/compositor_api/qwaylandsurfaceitem.cpp index dde6848b..55765c75 100644 --- a/src/compositor/compositor_api/qwaylandsurfaceitem.cpp +++ b/src/compositor/compositor_api/qwaylandsurfaceitem.cpp @@ -126,7 +126,6 @@ void QWaylandSurfaceItem::init(QWaylandSurface *surface) m_surface = surface; m_surface->setSurfaceItem(this); - m_surface->sendOnScreenVisibilityChange(m_clientRenderingEnabled); if (m_resizeSurfaceToItem) { updateSurfaceSize(); @@ -135,6 +134,8 @@ void QWaylandSurfaceItem::init(QWaylandSurface *surface) setHeight(surface->size().height()); } + updatePosition(); + setSmooth(true); setFlag(ItemHasContents); setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton | Qt::RightButton | @@ -287,6 +288,9 @@ void QWaylandSurfaceItem::surfaceUnmapped() void QWaylandSurfaceItem::surfaceDestroyed(QObject *) { + if (m_surface) + m_surface->setSurfaceItem(0); + m_surface = 0; } @@ -361,12 +365,11 @@ void QWaylandSurfaceItem::updateTexture() m_damaged = false; QSGTexture *oldTexture = texture; if (m_surface->type() == QWaylandSurface::Texture) { - QOpenGLContext *context = QOpenGLContext::currentContext(); QQuickWindow::CreateTextureOptions opt = 0; if (useTextureAlpha()) { opt |= QQuickWindow::TextureHasAlphaChannel; } - texture = window()->createTextureFromId(m_surface->texture(context), m_surface->size(), opt); + texture = window()->createTextureFromId(m_surface->texture(), m_surface->size(), opt); } else { texture = window()->createTextureFromImage(m_surface->image()); } |