4bd8475
From b12be8bcddf71b969c97580bd631a6a851a2ad43 Mon Sep 17 00:00:00 2001
4bd8475
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
4bd8475
Date: Thu, 28 Sep 2017 10:28:44 +0100
4bd8475
Subject: [PATCH] Resolves: tdf#42873 videos in presenter console misplaced
4bd8475
4bd8475
Change-Id: Ib7559246f6f3173acea72268db0489b79df38ae3
4bd8475
---
4bd8475
 slideshow/source/engine/shapes/viewmediashape.cxx | 18 +++++++++++++-----
4bd8475
 1 file changed, 13 insertions(+), 5 deletions(-)
4bd8475
4bd8475
diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx
4bd8475
index dcc14b9..99bc019 100644
4bd8475
--- a/slideshow/source/engine/shapes/viewmediashape.cxx
4bd8475
+++ b/slideshow/source/engine/shapes/viewmediashape.cxx
4bd8475
@@ -50,15 +50,16 @@
4bd8475
 #include <vcl/opengl/OpenGLContext.hxx>
4bd8475
 #endif
4bd8475
 
4bd8475
-#include <com/sun/star/media/XManager.hpp>
4bd8475
-#include <com/sun/star/media/XPlayer.hpp>
4bd8475
-#include <com/sun/star/media/XPlayerWindow.hpp>
4bd8475
+#include <com/sun/star/awt/XWindow.hpp>
4bd8475
 #include <com/sun/star/beans/XPropertySet.hpp>
4bd8475
+#include <com/sun/star/lang/XComponent.hpp>
4bd8475
 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
4bd8475
 #include <com/sun/star/lang/NoSupportException.hpp>
4bd8475
-#include <com/sun/star/awt/XWindow.hpp>
4bd8475
+#include <com/sun/star/media/XManager.hpp>
4bd8475
+#include <com/sun/star/media/XPlayer.hpp>
4bd8475
+#include <com/sun/star/media/XPlayerWindow.hpp>
4bd8475
+#include <com/sun/star/presentation/XSlideShowView.hpp>
4bd8475
 #include <com/sun/star/rendering/XCanvas.hpp>
4bd8475
-#include <com/sun/star/lang/XComponent.hpp>
4bd8475
 
4bd8475
 #include "viewmediashape.hxx"
4bd8475
 #include "mediashape.hxx"
4bd8475
@@ -473,6 +474,13 @@ namespace slideshow
4bd8475
                             {
4bd8475
                                 mpMediaWindow.disposeAndClear();
4bd8475
                                 mpMediaWindow = VclPtr<SystemChildWindow>::Create( pWindow, WB_CLIPCHILDREN );
4bd8475
+                                UnoViewSharedPtr xUnoView(std::dynamic_pointer_cast<UnoView>(mpViewLayer));
4bd8475
+                                if (xUnoView)
4bd8475
+                                {
4bd8475
+                                    awt::Rectangle aCanvasArea = xUnoView->getUnoView()->getCanvasArea();
4bd8475
+                                    aAWTRect.X += aCanvasArea.X;
4bd8475
+                                    aAWTRect.Y += aCanvasArea.Y;
4bd8475
+                                }
4bd8475
                                 mpMediaWindow->SetPosSizePixel( Point( aAWTRect.X, aAWTRect.Y ),
4bd8475
                                                            Size( aAWTRect.Width, aAWTRect.Height ) );
4bd8475
                             }
4bd8475
-- 
4bd8475
2.9.5
4bd8475