From b1dcf79595b2749de83e558992973ee16cce39aa Mon Sep 17 00:00:00 2001 From: Lasse Holmstedt Date: Mon, 20 Feb 2012 10:35:54 +0100 Subject: Fix issues with sendOnScreenVisibilityChange MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Initialize variables and send the event in the beginning so that we can be sure both client and server are in sync. Change-Id: Ibabd2fa3cfc2c7defd4804f3fcbdd184eba46652 Reviewed-by: Jørgen Lind --- src/compositor/compositor_api/waylandsurface.cpp | 2 +- src/compositor/compositor_api/waylandsurfaceitem.cpp | 5 +++++ src/compositor/wayland_wrapper/wlextendedsurface.cpp | 2 +- src/compositor/wayland_wrapper/wlextendedsurface.h | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/compositor/compositor_api/waylandsurface.cpp b/src/compositor/compositor_api/waylandsurface.cpp index 7effff050..f846aecb9 100644 --- a/src/compositor/compositor_api/waylandsurface.cpp +++ b/src/compositor/compositor_api/waylandsurface.cpp @@ -307,5 +307,5 @@ void WaylandSurface::sendOnScreenVisibilityChange(bool visible) { Q_D(WaylandSurface); if (d->surface->extendedSurface()) - d->surface->extendedSurface()->sendOnScreenVisibllity(visible); + d->surface->extendedSurface()->sendOnScreenVisibility(visible); } diff --git a/src/compositor/compositor_api/waylandsurfaceitem.cpp b/src/compositor/compositor_api/waylandsurfaceitem.cpp index 9418b4297..fa12b389b 100644 --- a/src/compositor/compositor_api/waylandsurfaceitem.cpp +++ b/src/compositor/compositor_api/waylandsurfaceitem.cpp @@ -75,6 +75,8 @@ WaylandSurfaceItem::WaylandSurfaceItem(QQuickItem *parent) , m_texture(0) , m_provider(0) , m_paintEnabled(true) + , m_useTextureAlpha(false) + , m_clientRenderingEnabled(false) , m_touchEventsEnabled(false) { } @@ -85,6 +87,8 @@ WaylandSurfaceItem::WaylandSurfaceItem(WaylandSurface *surface, QQuickItem *pare , m_texture(0) , m_provider(0) , m_paintEnabled(true) + , m_useTextureAlpha(false) + , m_clientRenderingEnabled(false) , m_touchEventsEnabled(false) { init(surface); @@ -101,6 +105,7 @@ void WaylandSurfaceItem::init(WaylandSurface *surface) m_surface = surface; m_surface->setSurfaceItem(this); + m_surface->sendOnScreenVisibilityChange(m_clientRenderingEnabled); setWidth(surface->size().width()); setHeight(surface->size().height()); diff --git a/src/compositor/wayland_wrapper/wlextendedsurface.cpp b/src/compositor/wayland_wrapper/wlextendedsurface.cpp index e4dd6bf45..1baa6e9fb 100644 --- a/src/compositor/wayland_wrapper/wlextendedsurface.cpp +++ b/src/compositor/wayland_wrapper/wlextendedsurface.cpp @@ -108,7 +108,7 @@ void ExtendedSurface::sendGenericProperty(const QString &name, const QVariant &v } -void ExtendedSurface::sendOnScreenVisibllity(bool visible) +void ExtendedSurface::sendOnScreenVisibility(bool visible) { int32_t visibleInt = visible; wl_resource_post_event(m_extended_surface_resource,WL_EXTENDED_SURFACE_ONSCREEN_VISIBILITY,visibleInt); diff --git a/src/compositor/wayland_wrapper/wlextendedsurface.h b/src/compositor/wayland_wrapper/wlextendedsurface.h index 0a28a9156..6edf64a08 100644 --- a/src/compositor/wayland_wrapper/wlextendedsurface.h +++ b/src/compositor/wayland_wrapper/wlextendedsurface.h @@ -80,7 +80,7 @@ public: ~ExtendedSurface(); void sendGenericProperty(const QString &name, const QVariant &variant); - void sendOnScreenVisibllity(bool visible); + void sendOnScreenVisibility(bool visible); void setSubSurface(ExtendedSurface *subSurface,int x, int y); void removeSubSurface(ExtendedSurface *subSurfaces); -- cgit v1.2.3