Fix issues with sendOnScreenVisibilityChange
authorLasse Holmstedt <lasse.holmstedt@nokia.com>
Mon, 20 Feb 2012 09:35:54 +0000 (10:35 +0100)
committerJørgen Lind <jorgen.lind@nokia.com>
Mon, 20 Feb 2012 09:40:37 +0000 (10:40 +0100)
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 <jorgen.lind@nokia.com>
src/compositor/compositor_api/waylandsurface.cpp
src/compositor/compositor_api/waylandsurfaceitem.cpp
src/compositor/wayland_wrapper/wlextendedsurface.cpp
src/compositor/wayland_wrapper/wlextendedsurface.h

index 7effff0..f846aec 100644 (file)
@@ -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);
 }
index 9418b42..fa12b38 100644 (file)
@@ -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());
index e4dd6bf..1baa6e9 100644 (file)
@@ -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);
index 0a28a91..6edf64a 100644 (file)
@@ -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);