diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2016-08-19 13:06:08 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2016-08-22 11:31:18 +0000 |
commit | b7075b72200b7b087e2c34fa449737970981ccea (patch) | |
tree | aeae0620bd3c64a8f836619d68ae5b4fd139dbf6 /examples/wayland/qwindow-compositor | |
parent | 768a28b284fa806cba38f864c56ba2e2c37296f2 (diff) |
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 <giulio.camuffo@kdab.com>
Diffstat (limited to 'examples/wayland/qwindow-compositor')
-rw-r--r-- | examples/wayland/qwindow-compositor/compositor.cpp | 8 | ||||
-rw-r--r-- | examples/wayland/qwindow-compositor/compositor.h | 2 | ||||
-rw-r--r-- | examples/wayland/qwindow-compositor/window.cpp | 2 |
3 files changed, 6 insertions, 6 deletions
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<QWaylandSurface *>(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) |