From 1ee7fec7f9820a1542c18b1fbfdb8d66d1ac1ba8 Mon Sep 17 00:00:00 2001 From: Michael Schuldt Date: Fri, 24 Aug 2012 12:00:57 +0200 Subject: [PATCH] X11WindowSystem : Fixing wrong composition. - 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. --- .../Renderers/Graphic/include/PlatformSurfaces/XPlatformSurface.h | 3 +-- .../Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/LayerManagerPlugins/Renderers/Graphic/include/PlatformSurfaces/XPlatformSurface.h b/LayerManagerPlugins/Renderers/Graphic/include/PlatformSurfaces/XPlatformSurface.h index 5491c27..a76be1d 100644 --- a/LayerManagerPlugins/Renderers/Graphic/include/PlatformSurfaces/XPlatformSurface.h +++ b/LayerManagerPlugins/Renderers/Graphic/include/PlatformSurfaces/XPlatformSurface.h @@ -54,8 +54,7 @@ public: bool isReadyForRendering() { - return true; - /*return m_isReadyForRendering;*/ + return m_isReadyForRendering; } // TODO: private/protected bool isMapped; diff --git a/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp b/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp index 14b5878..ea364dc 100644 --- a/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp +++ b/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp @@ -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; } -- 2.7.4