diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2019-05-17 11:28:35 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2019-05-21 11:31:58 +0200 |
commit | bbe1ede0fada499fd49b60bdc7964e311b331454 (patch) | |
tree | 88ef839bf6c2fb6b235528f4815d9d9a6724d6b8 /avmedia | |
parent | 0a13609598138a856e552ca3f35ea2d6fa433865 (diff) |
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>
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/gstreamer/gstplayer.cxx | 24 |
1 files changed, 16 insertions, 8 deletions
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) { |