diff options
author | Michael Schuldt <michael.schuldt@bmw.de> | 2013-03-26 03:16:41 -0700 |
---|---|---|
committer | Timo Lotterbach <timo.lotterbach@bmw-carit.de> | 2013-07-03 16:02:21 +0200 |
commit | 46dd8d5c76cf7845f80a40529d29479341f47efc (patch) | |
tree | 9bd80945ec7e7a4c0aff9e0d123c634d587df06e | |
parent | 92e71414f03955125437510e5037f18369273832 (diff) | |
download | layer_management-46dd8d5c76cf7845f80a40529d29479341f47efc.tar.gz |
X11WindowSystem: improved surface resize handling
Signed-off-by: Michael Schuldt <michael.schuldt@bmw.de>
-rw-r--r-- | LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp b/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp index 88a53b0..72feff4 100644 --- a/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp +++ b/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp @@ -21,6 +21,7 @@ #include "config.h" #include "Log.h" #include "Layer.h" +#include "Rectangle.h" #include <time.h> #include <sys/time.h> #include <X11/Xlib.h> @@ -263,8 +264,6 @@ void X11WindowSystem::configureSurfaceWindow(Window window) if (isWindowValid(window)) { LOG_DEBUG("X11WindowSystem", "Updating window " << window); - UnMapWindow(window); - MapWindow(window); XWindowAttributes att; XGetWindowAttributes(x11Display, window, &att); int winWidth = att.width; @@ -284,11 +283,28 @@ void X11WindowSystem::configureSurfaceWindow(Window window) LOG_DEBUG("X11WindowSystem", "Updating surface " << surface->getID()); - surface->OriginalSourceHeight = winHeight; - surface->OriginalSourceWidth = winWidth; + if (surface->OriginalSourceHeight != winHeight || surface->OriginalSourceWidth != winWidth) + { + surface->OriginalSourceHeight = winHeight; + surface->OriginalSourceWidth = winWidth; + + surface->damaged = false; // Waiting for damage event to get updated content + surface->m_surfaceResized = true /*surface->synchronized*/; + + Rectangle newDestination = surface->getDestinationRegion(); + newDestination.width = surface->OriginalSourceWidth; + newDestination.height = surface->OriginalSourceHeight; + surface->setDestinationRegion(newDestination); + + Rectangle newSource = surface->getSourceRegion(); + newSource.width = surface->OriginalSourceWidth; + newSource.height = surface->OriginalSourceHeight; + surface->setSourceRegion(newSource); + } + + UnMapWindow(window); + MapWindow(window); - surface->damaged = false; // Waiting for damage event to get updated content - surface->m_surfaceResized = true /*surface->synchronized*/; LOG_DEBUG("X11WindowSystem", "Done Updating window " << window); } } |