diff options
-rw-r--r-- | avmedia/source/gstreamer/gstplayer.cxx | 24 | ||||
-rw-r--r-- | vcl/qt5/Qt5Object.cxx | 2 |
2 files changed, 17 insertions, 9 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) { 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; |