X11WindowSystem : Fixing wrong composition.
authorMichael Schuldt <michael.schuldt@bmw.de>
Fri, 24 Aug 2012 10:00:57 +0000 (12:00 +0200)
committerMichael Schuldt <michael.schuldt@bmw.de>
Fri, 24 Aug 2012 10:00:57 +0000 (12:00 +0200)
- If a running application will be destroyed or the window
  will be unmapped, there was an issue that the composition will
  display garbage at top of any surfaces.

- Due to the fact that enableRendering and disableRendering is introduced
  that issue is fixed.

LayerManagerPlugins/Renderers/Graphic/include/PlatformSurfaces/XPlatformSurface.h
LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp

index 5491c27..a76be1d 100644 (file)
@@ -54,8 +54,7 @@ public:
 
     bool isReadyForRendering()
     {
-       return true;        
-       /*return m_isReadyForRendering;*/
+        return m_isReadyForRendering;
     }
     // TODO: private/protected
     bool isMapped;
index 14b5878..ea364dc 100644 (file)
@@ -334,6 +334,7 @@ void X11WindowSystem::MapWindow(Window window)
             surface->renderPropertyChanged = true;
 
             graphicSystem->getTextureBinder()->createClientBuffer(surface);
+            x11surf->enableRendering();
             XSync(x11Display, 0);
 
             LOG_DEBUG("X11WindowSystem", "Mapping Surface " << surface->getID() << " to window " << window);
@@ -349,7 +350,7 @@ void X11WindowSystem::UnMapWindow(Window window)
     if (isWindowValid(window))
     {
         LOG_DEBUG("X11WindowSystem", "Unmapping surface from window " << window);
-        Surface* surface = getSurfaceForWindow(window);
+        Surface* surface = getSurfaceForWindow(window);        
         if (!surface)
         {
             LOG_WARNING("X11WindowSystem", "Could not unmap window " << window);
@@ -361,6 +362,7 @@ void X11WindowSystem::UnMapWindow(Window window)
             return;
         }
         XPlatformSurface* x11surf = (XPlatformSurface*)surface->platform;
+        x11surf->disableRendering();
         LOG_DEBUG("X11WindowSystem", "Unmapping surface " << surface->getID());
         if (!x11surf->isMapped)
         {
@@ -453,7 +455,7 @@ void X11WindowSystem::DestroyWindow(Window window)
     if (isWindowValid(window))
     {
         LOG_DEBUG("X11WindowSystem", "Destroying Surface for window " << window);
-        Surface* surface = getSurfaceForWindow(window);
+        Surface* surface = getSurfaceForWindow(window);        
         if (!surface)
         {
             LOG_WARNING("X11WindowSystem", "Could not find surface for window " << window);
@@ -464,6 +466,8 @@ void X11WindowSystem::DestroyWindow(Window window)
         UnMapWindow(window);
         LOG_DEBUG("X11WindowSystem", "Remove Native Content from Surface " << surface->getID());
         surface->removeNativeContent();
+        /* To force a recomposition of all surface which are behind of that surface inside the Layer RenderOrder */
+        surface->renderPropertyChanged = true;
         delete surface->platform;
         surface->platform = NULL;
     }