diff options
author | Andrew Knight <andrew.knight@digia.com> | 2013-08-08 16:14:13 +0300 |
---|---|---|
committer | Andy Nichols <andy.nichols@digia.com> | 2013-08-09 14:11:11 +0200 |
commit | 155363561757575f147ccd8c250699ae17af0d6f (patch) | |
tree | 7cd4f1d526431c85d5e6698929fb67110dc05ad2 /src/compositor/wayland_wrapper/qwlextendedsurface.cpp | |
parent | 434700e713030173da694db31ce6908b902de592 (diff) |
Integrate QWindow::Visibility into Compositor API
This enhances the onscreen_visibility extension to use QWindow's
visibility API. This way, the compositor can set the QWindow::visibility
on a Qt client. Any client that updates its window type through wl_shell
will also have its QWaylandSurface::visibility property updated, and the
compositor can choose to composite the surface accordingly. This also
simplifies exposure handling in QWaylandWindow so that it can use the
base implementation.
The existing use of this extension, setClientRenderingEnabled, is kept for
compatibility, and maps to QWindow::Hidden (false) and
QWindow::AutomaticVisibility (true).
Change-Id: If009649b98c792ca79585fbb09ea7912efeef7da
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Diffstat (limited to 'src/compositor/wayland_wrapper/qwlextendedsurface.cpp')
-rw-r--r-- | src/compositor/wayland_wrapper/qwlextendedsurface.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/compositor/wayland_wrapper/qwlextendedsurface.cpp b/src/compositor/wayland_wrapper/qwlextendedsurface.cpp index 0f6ce8caa..4f1791da2 100644 --- a/src/compositor/wayland_wrapper/qwlextendedsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlextendedsurface.cpp @@ -83,12 +83,18 @@ void ExtendedSurface::sendGenericProperty(const QString &name, const QVariant &v } -void ExtendedSurface::sendOnScreenVisibility(bool visible) +void ExtendedSurface::setVisibility(QWindow::Visibility visibility, bool updateClient) { - int32_t visibleInt = visible; - send_onscreen_visibility(visibleInt); -} + if (visibility == m_visibility) + return; + m_visibility = visibility; + emit m_surface->waylandSurface()->visibilityChanged(); + + // If this change came from the client, we shouldn't update it + if (updateClient) + send_onscreen_visibility(m_visibility); +} void ExtendedSurface::extended_surface_update_generic_property(Resource *resource, const QString &name, |