tdf#124027: use ID of the embedded window and fix position of overlay
1) after many trials and errors what LibO apparently expects here is
the ID of QWindow parent of [embedded] system child window
2) the position of the embedded window for video overlay has already
been translated relative to the top-left corner of the slide (see
bugfix of tdf#42873 how) in gen, gtk and kde5 vclplugs. So let's limit
translating it 2nd time only to gtk3 vclplug which for some reason
behaves differently
(regression from 18138417485aeba6c52d935c616dba829b24ffd8)
Change-Id: Ie4c6d14a50959c0fdd04e745918d4889c9da45ec
Reviewed-on: https://gerrit.libreoffice.org/72458
Tested-by: Jenkins
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx
index 78928cd..6303bc5 100644
--- a/avmedia/source/gstreamer/gstplayer.cxx
+++ b/avmedia/source/gstreamer/gstplayer.cxx
@@ -926,19 +926,27 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co
rArguments[ 2 ] >>= pIntPtr;
SystemChildWindow *pParentWindow = reinterpret_cast< SystemChildWindow* >( pIntPtr );
if (pParentWindow)
{
Point aPoint = pParentWindow->GetPosPixel();
maArea.X = aPoint.getX();
maArea.Y = aPoint.getY();
}
const SystemEnvData* pEnvData = pParentWindow ? pParentWindow->GetSystemData() : nullptr;
OSL_ASSERT(pEnvData);
if (pEnvData)
{
OUString aToolkit = OUString::createFromAscii(pEnvData->pToolkit);
// tdf#124027: the position of embedded window is identical w/ the position
// of media object in all other vclplugs (gtk, kde5, gen), in gtk3 w/o gtksink it
// needs to be translated
if (aToolkit == "gtk3")
{
if (pParentWindow)
{
Point aPoint = pParentWindow->GetPosPixel();
maArea.X = aPoint.getX();
maArea.Y = aPoint.getY();
}
}
#if defined(ENABLE_GTKSINK)
GstElement *pVideosink = g_strcmp0(pEnvData->pToolkit, "gtk3") == 0 ?
GstElement *pVideosink = (aToolkit == "gtk3") ?
gst_element_factory_make("gtksink", "gtksink") : nullptr;
if (pVideosink)
{
diff --git a/vcl/qt5/Qt5Object.cxx b/vcl/qt5/Qt5Object.cxx
index b195272..0f3a4f2 100644
--- a/vcl/qt5/Qt5Object.cxx
+++ b/vcl/qt5/Qt5Object.cxx
@@ -40,7 +40,7 @@ Qt5Object::Qt5Object(Qt5Frame* pParent, bool bShow)
m_pQWidget->show();
m_aSystemData.nSize = sizeof(SystemEnvData);
m_aSystemData.aWindow = pParent->GetQWidget()->winId();
m_aSystemData.aWindow = m_pQWindow->winId(); // ID of the embedded window
m_aSystemData.aShellWindow = reinterpret_cast<sal_IntPtr>(this);
//m_aSystemData.pSalFrame = this;
//m_aSystemData.pWidget = m_pQWidget;