From b7075b72200b7b087e2c34fa449737970981ccea Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 19 Aug 2016 13:06:08 +0200 Subject: Rename QWaylandSurface::isMapped to hasContent It was potentially misleading, since "mapped" is already used with a slightly different meaning in the Wayland protocol. In the protocol, mapped means that the surface should be rendered. The renamed property, on the other hand, is true if the surface has a buffer with contents attached and committed. In some cases this is not the same, i.e. the drag icon after dropping, or xdg_popups after popup_done. Change-Id: Idc359433c6130e3815de57b21d4edb13e318887d Reviewed-by: Giulio Camuffo --- examples/wayland/qwindow-compositor/compositor.cpp | 8 ++++---- examples/wayland/qwindow-compositor/compositor.h | 2 +- examples/wayland/qwindow-compositor/window.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'examples/wayland/qwindow-compositor') diff --git a/examples/wayland/qwindow-compositor/compositor.cpp b/examples/wayland/qwindow-compositor/compositor.cpp index b7cdbbd9f..13e5718d2 100644 --- a/examples/wayland/qwindow-compositor/compositor.cpp +++ b/examples/wayland/qwindow-compositor/compositor.cpp @@ -171,7 +171,7 @@ void Compositor::create() void Compositor::onSurfaceCreated(QWaylandSurface *surface) { connect(surface, &QWaylandSurface::surfaceDestroyed, this, &Compositor::surfaceDestroyed); - connect(surface, &QWaylandSurface::mappedChanged, this, &Compositor::surfaceMappedChanged); + connect(surface, &QWaylandSurface::hasContentChanged, this, &Compositor::surfaceHasContentChanged); connect(surface, &QWaylandSurface::redraw, this, &Compositor::triggerRender); connect(surface, &QWaylandSurface::subsurfacePositionChanged, this, &Compositor::onSubsurfacePositionChanged); @@ -184,10 +184,10 @@ void Compositor::onSurfaceCreated(QWaylandSurface *surface) connect(surface, &QWaylandSurface::offsetForNextFrame, view, &View::onOffsetForNextFrame); } -void Compositor::surfaceMappedChanged() +void Compositor::surfaceHasContentChanged() { QWaylandSurface *surface = qobject_cast(sender()); - if (surface->isMapped()) { + if (surface->hasContent()) { if (surface->role() == QWaylandWlShellSurface::role() || surface->role() == QWaylandXdgSurface::role() || surface->role() == QWaylandXdgPopup::role()) { @@ -374,7 +374,7 @@ void Compositor::adjustCursorSurface(QWaylandSurface *surface, int hotspotX, int m_cursorHotspotX = hotspotX; m_cursorHotspotY = hotspotY; - if (surface && surface->isMapped()) + if (surface && surface->hasContent()) updateCursor(); } diff --git a/examples/wayland/qwindow-compositor/compositor.h b/examples/wayland/qwindow-compositor/compositor.h index 243e5dbef..3de25a9bb 100644 --- a/examples/wayland/qwindow-compositor/compositor.h +++ b/examples/wayland/qwindow-compositor/compositor.h @@ -119,7 +119,7 @@ signals: void frameOffset(const QPoint &offset); private slots: - void surfaceMappedChanged(); + void surfaceHasContentChanged(); void surfaceDestroyed(); void viewSurfaceDestroyed(); void onStartMove(); diff --git a/examples/wayland/qwindow-compositor/window.cpp b/examples/wayland/qwindow-compositor/window.cpp index 86a1f8651..b73c7be39 100644 --- a/examples/wayland/qwindow-compositor/window.cpp +++ b/examples/wayland/qwindow-compositor/window.cpp @@ -129,7 +129,7 @@ void Window::paintGL() m_textureBlitter.bind(currentTarget); } QWaylandSurface *surface = view->surface(); - if (surface && surface->isMapped()) { + if (surface && surface->hasContent()) { QSize s = surface->size(); if (!s.isEmpty()) { if (m_mouseView == view && m_grabState == ResizeGrab && m_resizeAnchored) -- cgit v1.2.3