avmedia/source/gstreamer/gstplayer.cxx | 24 ++++++++++++++++-------- vcl/qt5/Qt5Object.cxx | 2 +- 2 files changed, 17 insertions(+), 9 deletions(-)
New commits: commit bbe1ede0fada499fd49b60bdc7964e311b331454 Author: Katarina Behrens <katarina.behr...@cib.de> AuthorDate: Fri May 17 11:28:35 2019 +0200 Commit: Katarina Behrens <katarina.behr...@cib.de> CommitDate: Tue May 21 11:31:58 2019 +0200 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.behr...@cib.de> diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index 78928cddcc45..6303bc53bb68 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 b1952727c3a2..0f3a4f29750a 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits